Any executable script or file can be added as a monitoring probe with the web interface to set up and pass args.
Each custom probe consists of two files:
- the executable file (script or binary file),
- the configuration file which describes the monitoring section for this probe to pass corresponding arguments.
The configuration file must:
- be placed to the folder with the executable file;
- have the name of the executable file with the additional extension .conf:
Executable files of custom probes can be grouped in subfolders with any number of sublevels:
The probes are grouped and displayed in the web interface taking into account the subfolders:
When adding or modifying custom probes the changes are applied with refreshing the page in a web browser.
Probe identifiers, which are used by the server and the agents, are created automatically. The identifiers are equal to the names of the executable files with the part of the path from the configured folder, e.g. cisco/task_1.
The identifier of a custom probe must not match the identifier of a standard probe. Otherwise, the custom probe will be ignored.
See the list of the standard probes identifiers - Hiding unused probes.
Probe identifiers are case-sensitive.
Custom probes are executed by the agents locally, so it is required to copy the executable files to the same folder on each host, which is supposed to execute the probes on.
For configuration files, it is sufficient to put them on the hosts with the server of the system.
Folder for custom probes
Custom probes folder is set in the server configuration file .
It is necessary to:
- Add the monitoring section into the file.
Set the full path to the folder where the custom tasks are stored in the parameter custom_tasks_path:
Restart the server:
Parameters of the custom probe
Custom probe parameters are set in the JSON file named as executable_file_name.conf. For instance, if the executable file is named as mySensor.sh, then the configuration file must be named as mySensor.sh.conf.
The configuration file must be placed into the same folder as the executable file.
Probes without the configuration files are ignored.
The configuration file can contain the following fields:
Probe name which is displayed in the web interface in a list of probes.
By default - the probe identifier, generated from the path and the name of the probe:
Icon from the Font Awesome kit, which is displayed with the name of the probe.
By default -('fa fa-cubes fa-fw')
List of object class IDs which the probe is not available for.
By default, the probe is available for all object classes.
|args||The array of the arguments, which are set by users in the web interface and passed to the executable file.|
Argument name, which is passed to the executable file.
The default value of the argument, which is entered into the corresponding field during the probe creation.
Description of the argument, which is displayed in the web interface.
Argument name, which is displayed in the web interface.
Applicable only for the select type (args.type.select).
Defines the list of argument values, which are displayed in the web interface.
The following is passed to the executable file:
This logic can be used to implement the "Not selected" option and delimiters in the dropdown list.
Description of the argument value, which is displayed in the web interface.
By default the argument value (args.options.value) is displayed.
If this field is not set, then the argument name is not passed to the executable file. These options can be used in order to implement the "Not selected" option and delimiters in the dropdown list.
Indicates if the argument value is required.
By default false.
Type of the argument value.
By default | text.
By default it is disabled.
When it is enabled the value of the args.id field (argument name) is passed to the executable file. If the field is not set, then the index number of the argument is passed to the executable file (starting from 0).
|args.type.password||The text field with masking of input characters.|
|args.type.text||Text field to enter argument value.|
Text field to enter argument value.
Allows to enter multiline text.
Custom probe example
To demonstrate the custom probe script and different argument types we have prepared two files.
Place the files to the custom probes folder, create a new object with this probe in the web interface and try to change argument values.
This custom probe displays all passed arguments:
This configuration file contains examples for all argument types:
Using operating system utilities
If some utilities, which can be used for data collection and monitoring, have been installed in the operation system, it is possible to reuse those creating a reference to the executable file in the custom probes folder and adding the configuration file.
Here is the example of adding the cURL command-line tool.
Go to the custom probes folder:
Get the path to the cURL binary:
Create the reference with the cURL name and path:
Create the configuration file for the probe:
After refreshing the browser page you will see cURL reuse probe in the list. This probe has only one required argument.