EV Observe - Use Global-Plugin-Execution Service Template
The Global-Plugin-Execution service template is used to run a custom program located on the Box.
The program must comply with certain conditions before it can be implemented in the Boxes. See Configuration of the program
Notes
- The custom program must be deployed on every Box in the IT infrastructure.
- The information returned by the custom program is encrypted and stored in the database. It remains visible to any user with access to the configuration page of the service.
Configuration of the custom program
- File encryption: LATIN
- The custom program must have the following return codes as shown in the table below.
Value | Status interpreted in EV Observe | |
---|---|---|
0 | OK ==> ![]() |
|
1 | Warning ==> ![]() |
|
2 | Critical ==> ![]() |
|
3 | Unknown ==> ![]() |
- The result must appear in a single row.
The result returned can contain performance data. In this case, it must be in the following format.
text displayed in the EV Observe details field| ‘metricname’=value[unit];[warning threshold];[critical threshold];[min value];[max value]
- List of metric names / Values separated by a space
- The metric name can contain any character except for the equal sign (=) and the single quote mark (‘). The single quote mark is used to surround metric names containing spaces.
- The use of single quote marks for surrounding the metric name is optional. It is only mandatory if metricname contains spaces.
- You can enter any metric name you want. It must not exceed 19 characters, its name must be unique in the result row and it must not contain single quote marks (‘).
- [warning threshold];[critical threshold];[min value];[max value] can be null, e.g. if the threshold is not defined or if minimum and maximum values are not applicable. If the semi-colons do not separate any value, they can be deleted. Minimum and maximum values are not required if the unit is %
- Value, warning threshold, critical threshold, min value and max value are in class [-0-9] and their unit must be identical for a given metric.
- Unit is a string containing one or more characters. The following characters are prohibited: numbers, semi-colons, single and double quote marks.
example
- No unit specified: This indicates a certain number (integer or float) of entities, such as users, processes, average load
- s – seconds (also min, ms, etc.)
- % – percentage
- B – bytes (also KB, MB, TB)
Procedure: How to use the service template
Step 1: Deploy the custom program on every Box
1. Run the command below to copy the program to the Box folder.
usr/local/nagios/libexec/custom_plugin
2. Run the commands below to assign run and ownership permissions.
Replace <PluginName.pl> with the name of your program.
chown nagios:nagios usr/local/nagios/libexec/custom_plugin/<PluginName.pl>
chmod 755 /usr/local/nagios/libexec/custom_plugin/<PluginName.pl>
3. Repeat the procedure for every Box in the IT infrastructure.
Step 2: Set up monitoring of the custom program using the Global-Plugin-Execution service template
SelectCompanyInCompanyTree_Procedure
1. Go to the Web app.
2. Select the company from the company tree structure.
Notes:
- The selected company must be associated with a Box.
- You can create a new company.
See the procedure
3. Create a new service.
- Select Configuration > Services > List in the menu.
- Click + Add in the Mode: Box tab.
4. Specify the information below.
General information tab
- Service template: Select the Global-Plugin-Execution service template.
- Name: Enter the name of the new service to be created. Its name should correspond to the event to be captured.
example Link Down
Availability and checks tab
- Plugin file to execute: Name of the program.
- Plugin arguments: List of program arguments
- Arguments must be passed in the following format, -H ‘value’ or –host ‘value’.
example -c ‘public’ ; –url ‘https://myurl.com’
- Argument values must be surrounded by double quote marks, e.g. "value", or apostrophes, e.g. 'value'.
- To enter a value containing double quote marks in an instruction surrounded by double quote marks, use the \ character.
example -h $HOSTADDRESS$ –URI ‘mylogin.php’ –pwd ‘eyi"kim58’ –text ‘Rue de l'"'"'alma’
- To enter a value containing apostrophes in an instruction surrounded by apostrophes, surround each apostrophe with double quote marks.
example -h $HOSTADDRESS$ –URI ‘mylogin.php’ –pwd "eyi\"kim58" –text "Rue de l’alma"
- You can use the following variables:
- $_SERVICEHOSTALIAS$: Returns the name of the host associated with the service.
- $HOSTADDRESS$: Returns the IP address of the host associated with the service.
- $_SERVICEDISPLAYNAME$: Returns the name of the service as specified in ServiceNav.
- $_SERVICEIDSERVICE$: Returns the unique ID of the service.
- $_HOSTCOMPANYNAME$: Returns the name of the company of the host associated with the service.
- $_HOSTHOST_CATEGORY_NAME$: Returns the name of the host category associated with the service.
- You cannot use the account variables specified for the company and/or host. You must specify the credentials required for the program in the Plugin arguments field.
- Arguments must be passed in the following format, -H ‘value’ or –host ‘value’.
5. Click Validate.