---
title: "How to use the macOS inventory scripts as a Psuedo Agent | v8+"
canonical: "https://ai-docs.certero.com/space/CUP/119832880/How%20to%20use%20the%20macOS%20inventory%20scripts%20as%20a%20Psuedo%20Agent%20%7C%20v8%2B"
format: markdown
---
With Remote Inventory, an endpoint server is connecting to a Linux or Unix computer, copying the inventory script file and then executing the script. With the Pseudo agent, it is the client computer that is initiating the communication. Connecting to the endpoint server, to retrieve the inventory script. Executing the script and then uploading the inventory file to the endpoint server.
For Mac computers, customers can perform Remote Inventory or install the Mac version of the Certero Client agent. Endpoint servers do have an agentless inventory script for mac computers, called csinvm-agentless-x86_64.run. For instances where you wish to call the psuedo agent and upload inventory files, you can follow the below process:
1. Copy the MAC Pseudo Agent script from below. (Suggested file name csinvm.sh)
2. Replace <TenantID> with the valid tenant ID for the Certero platform.
3. Replace <EndpointServer> with the FQDN of the Endpoint Server the Mac computer can access.
4. Copy the script to the MAC computer
5. Make the script file executable
6. Run the script
7. The inventory script could be scheduled via ‘cron’ or other scheduling tools.
# MAC Pseudo Agent Script
```
#!/bin/bash
# Parse arguments for verbose mode
VERBOSE=0
for arg in "$@"; do
case $arg in
-v|--verbose)
VERBOSE=1
;;
esac
done
# Certero macOS Agentless Inventory Script
TENANT_ID="<TenantID>"
UPLOAD_ENDPOINT="https://<EndpointServer>/CerteroEndPointServer"
INVENTORY_SCRIPT_URL="https://<EndpointServer>/CerteroEndpointServer/Client/Apple/csinvm-agentless-x86_64.run"
# Create and switch to temp dir
tmpDir=$(mktemp -d) || { echo "Failed to create temp dir"; exit 4; }
trap 'rm -rf "$tmpDir"' EXIT
cd "$tmpDir" || exit 1
echo "Downloading inventory script..."
curl -L -o certero-inventory.run "$INVENTORY_SCRIPT_URL" || { echo "Download failed"; exit 1; }
chmod +x certero-inventory.run
echo "Running inventory script..."
./certero-inventory.run
RC=$?
[[ $RC -ne 0 && $RC -ne 255 ]] && { echo "Script failed with code $RC"; exit 2; }
# Locate all inventory files.
INVENTORY_FILES=( $(find . -type f -name "mac-*.tgz") )
if [[ ${#INVENTORY_FILES[@]} -eq 0 ]]; then
echo "No inventory files found"; exit 3;
fi
# Upload each inventory file
UPLOAD_URL="${UPLOAD_ENDPOINT}/Client/Upload?tenantId=${TENANT_ID}&e=tgz"
for FILE in "${INVENTORY_FILES[@]}"; do
echo "Uploading inventory: $FILE"
if [[ $VERBOSE -eq 1 ]]; then
curl --fail --verbose --header "Content-Type: application/octet-stream" \
--data-binary "@${FILE}" \
"$UPLOAD_URL" || { echo "Upload failed for $FILE"; exit 5; }
else
curl --fail --header "Content-Type: application/octet-stream" \
--data-binary "@${FILE}" \
"$UPLOAD_URL" || { echo "Upload failed for $FILE"; exit 5; }
fi
echo "Upload complete as: $FILE"
done
```
# Example output
Here is an example output of running the script:
```
consultancy@CERT-AP01 Downloads % ./csinvm.sh
Downloading inventory script...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 754k 100 754k 0 0 4088k 0 --:--:-- --:--:-- --:--:-- 4099k
Running inventory script...
Verifying archive integrity... 100% MD5 checksums are OK. All good.
Uncompressing Certero Agentless Client for macOS x86_64 100%
******************************************************************
* *
* Certero client inventory tool *
* Copyright(c) Certero 2024. All rights reserved. *
* *
* O/S : Mac OS X 13.7.6 *
* Arch : x86_64 *
* Info : http://www.certero.com *
* Email : help@certero.com *
* *
******************************************************************
Running Core inventory
2025-07-30 09:20:31 - INFO: Performing inventory
2025-07-30 09:20:31 - INFO: Performing system information queries
2025-07-30 09:20:31 - INFO: Performing processor information queries
2025-07-30 09:20:31 - INFO: Querying installed modules
2025-07-30 09:20:31 - INFO: Inventory process was running for 0 seconds
Running Full inventory
2025-07-30 09:20:32 - INFO: Performing inventory
2025-07-30 09:20:32 - INFO: Querying system profiler
2025-07-30 09:20:32 - INFO: Checking installed memory
2025-07-30 09:20:32 - INFO: Querying disk and partition information
2025-07-30 09:20:32 - INFO: Checking disc burning capabilities
2025-07-30 09:20:33 - INFO: Querying network configuration
2025-07-30 09:20:33 - INFO: Checking for bluetooth adapters
2025-07-30 09:20:33 - INFO: Querying graphics adapters
2025-07-30 09:20:33 - INFO: Querying display information
2025-07-30 09:20:34 - INFO: Querying Printer information
2025-07-30 09:20:34 - INFO: Querying USB information
2025-07-30 09:20:34 - INFO: Retrieving list of system groups
2025-07-30 09:20:35 - INFO: Retrieving list of system users
2025-07-30 09:20:35 - INFO: Retrieving list of system processes
2025-07-30 09:20:35 - INFO: Retrieving list of disk free counts
2025-07-30 09:20:35 - INFO: Retrieving list of machine event times
2025-07-30 09:20:35 - INFO: Retrieving list of installed applications
2025-07-30 09:20:35 - INFO: Retrieving list of installed fonts
2025-07-30 09:20:41 - INFO: Scanning for software identification (SWID) tags
2025-07-30 09:20:41 - INFO: Checking for docker
2025-07-30 09:20:41 - INFO: Inventory process was running for 9 seconds
Checking browser history
2025-07-30 09:20:42 - INFO: Process was running for 0 seconds
End of inventory process
Uploading inventory: ./mac-cert-ap01.local-24ee48775c8b557b84ceb81a0d4b663c-0.tgz
Upload complete as: ./mac-cert-ap01.local-24ee48775c8b557b84ceb81a0d4b663c-0.tgz
Uploading inventory: ./mac-cert-ap01.local-24ee48775c8b557b84ceb81a0d4b663c-1.tgz
Upload complete as: ./mac-cert-ap01.local-24ee48775c8b557b84ceb81a0d4b663c-1.tgz
```
<span style="color: #000000">Although the output shows the inventory filenames being as </span><span style="color: #000000">**mac-<computer name>-<UUID>-n.tgz**</span><span style="color: #000000">, the filenames used in the upload are </span><span style="color: #000000">**<tenantid>.tgz**</span><span style="color: #000000">. Multiple files called </span><span style="color: #000000">**<tenantid>.tgz**</span><span style="color: #000000"> can be uploaded, one at a time, to the endpoint server but they are saved in the UploadDir folder on the endpoint server as nnnnnnnn.tgz. The exact number of digits (n) will vary as the endpoint server has an inbuilt counter that keeps increasing. You can see the filenames referenced in the </span><span style="color: #000000">**CollectionService_YYYYMMDD.log**</span><span style="color: #000000"> file in the endpoint server logs folder.</span>
<span style="color: #000000">E.G.</span>
```
2025-07-29 09:17:56.909 - INFORMATION: Processing file [1274862718.tgz]
2025-07-29 09:17:56.968 - DEBUG: Started executing 'ProcessFile' method in module 0
2025-07-29 09:17:56.968 - DEBUG: Processing E:\Certero\Endpoint Server\UploadDir\Temp\1274862718\Core.ComputerSystemInventory.txt
2025-07-29 09:17:56.969 - DEBUG: Processing E:\Certero\Endpoint Server\UploadDir\Temp\1274862718\Core.ComputerSystemModule.txt
2025-07-29 09:17:56.970 - DEBUG: Processing E:\Certero\Endpoint Server\UploadDir\Temp\1274862718\Core.ComputerSystemProcessorInfo.txt
```
<span style="color: #000000">To review, the inventory filenames created on the mac have one naming standard. They are received on the endpoint server in a different naming standard. But the files contents are the same. The Mac agentless inventory script (csinvm-agentless-x86_64.run) will produced at least two inventory files (but possibly more).</span>
<span style="color: #000000">E.G. </span>
```
mac-<computer name>-<UUID>-0.tgz is the Core Inventory
mac-<computer name>-<UUID>-1.tgz is the Full Inventory
```