How to use the Linux and Unix inventory scripts as a Pseudo Agent | v8+
Certero has had a command-line inventory script for Linux and other UNIX variants available for many years, the inventory script could be scheduled via ‘cron’ or other scheduling tools, the inventory data then had to be copied to a folder on the Certero Endpoint Server for processing.
For some organisations, the transferring of the inventory data could be a challenge due to security constraints or third-party tools being required to copy the file.
To enable the creation of a pseudo agent, Certero has added the functionality to enable the inventory data to be uploaded directly to the Certero Endpoint Server.
Approach
There are two commands that are available on most distros of Linux and other UNIX variants called 'curl' and 'wget' (N.B. These packages may not be installed by default), with the use of these commands a script can be created to run the command-line inventory and then upload the inventory data. The commands can also be used to download the latest version of the inventory script:
Download the latest script using curl
Run the inventory script
Upload the inventory data
To download the latest script (csinvcli.sh) using 'curl' the following command can be used:
i.e. For Linux
Available variants are: Aix, Hpux, Linux and Solaris
N.B. A ‘-k’ parameter may need to be used when using 'https' to communicate with internal endpoint servers where the certificate may be self-signed and the target device may not trust it.
Running the inventory script:
Uploading the inventory data:
N.B. To ensure the upload has been successful the http status code needs to be checked for 200 response
See the example for Linux below: