Enable checks from the community for Agent Client Collector
You can take checks from the github community and customize them for use in the Agent Client Collector (ACC), or you can compose your own scripts. Create a plugin with the customized Sensu check and install it on a ServiceNow instance.
Before you begin
Role required: agent_client_collector_admin
Procedure
Copy a check from the github community to your local machine.
Create a
tar.gzfile to be appended to your plugin:Create a folder on your local machine.
Create a sub-folder called
bin.Place the checks you want to run (scripts and executables) in the
binfolder.In a Linux environment, give executable permissions to the checks by running
chmod +x filenameon each of the checks.Navigate to the parent folder (above the bin folder).
In a Linux environment, run the
tar -C <parent_folder_name> --zcvf <my_plugin_name>.tar.gz *command.In a Windows environment, use an archiving utility that supports the
tar.gzformat.In a Windows environment, ensure that you include the following scripts in the
binfolder:A batch script configured to run on the check command and initiate the run. For example,
powershell <%~dp0>\test.ps1The
<%~dp0>variable directs to the drive (d) and path (p) of the batch file.The relevant script (for example,
test.ps1) to be executed in the batch script.- Create a new ACC plugin, as described in Create and edit Agent Client Collector plugins.
Test the new plugin.
Create a new check definition for the customized Sensu check.
For details, see Create and edit checks.
On the Check Definition page, navigate to the Related Links section and select Generate allow list content.
Copy the entries you want to include in the allow list and add them to the agent's
check-allow-list.jsonfile, either manually or using an automation tool.The location of this file is indicated in the
allow-listparameter of the agent'sacc.ymlfile.Create a new policy and add the newly created check definition.
For details on creating a policy, see Create an Agent Client Collector policy.
Select the check definition and in the Related Links section, select Test check.
Enable credentials when testing a check:
Navigate to Connections & Credentials > Credentials.
Click New.
Select the type of credentials you want to create.
For details on creating credentials, see Create a Connection and Credential alias.
Enter values in the fields on the page to assign credentials to your selected credential type.
Click Submit.
Create secure parameters for your check, as described in Create secure parameters for a check.