Using the Global-Plugin-Execution service template

On the page

Need some help?

warning svgrepo com Disclaimer :

The release of this new service templates is accompanied by new ServiceNav product terms and conditions available here : See in particular sections 8 and 4.5 for SaaS platforms and section 6.7 of the support conditions for OnPremise platforms.

The use of this service template therefore implies the following conditions:

  • The support provided by Coservit is limited to the product code provided to the customer, and Coservit does not provide support on the executed code provided by the customer.
  • Coservit no longer provides support on a ServiceNav Box whose components may have been modified (in addition to the file submitted by the customer), particularly in the event of installation or updating of additional software (packages) or the ServiceNav Box operating system.
  • In the event of a support request and/or abnormal activity on the platform and in case of reasonable doubt by the support technician, Coservit reserves the right to move/modify the product code by the customer and to stop its operation, informing the customer according to usual support procedures.

How the Global-Plugin-Execution service template works

Preparation and prerequisites of the client program

The idea behind the Global-Plugin-Execution service template is to allow the running of a program/script customised by the customer and transferred to the ServiceNav Box.

To function correctly, this program must meet the following conditions:

  • Encoding type : LATIN
  • The program must produce a return code according to the table below
Value Interpreted status in ServiceNav
0 OK (green)
1 Warning (orange)
2 Critical (red)
3 Unknown (grey)
  • Program output must be a single line
  • The output may contain performance data, in which case the output must be of the form :

text displayed in the ServiceNav detail field| 'metric-name'=value [unit]; [warning threshold]; [critical threshold]; [min value]; [max value].

    • list of metric name / value names separated by spaces
    • the metric name can contain any character except the equal sign (=) or the quote sign (')
    • single quotation marks for the metric name are optional, but MANDATORY if name contains spaces
    • the name of the metric is flexible insofar that it:, must be less than 19 characters long, unique in the output line and must not contain the quote sign (')
    • [warning threshold]; [critical threshold]; [min value]; [max value] can be zero (e.g. if the threshold is not defined or if min and max do not apply). Blank separating semicolons can be omitted. Min and max are not required if the unit is %
    • value, warning threshold, critical threshold, min and max must use numbers [0-9] and must all use the same units for a given metric.
    • Unit is a string of one or more characters. The following characters are prohibited: numbers, semicolons, single or double quotation marks.
      • A few examples:
        • no units specified - Indicates a number (int or float) of entities (e.g., number of users or processes, load averages)
        • s - seconds (also min, ms, ...)
        • % - percentage
        • B - bytes (also KB, MB, TB)

If your program meets the above requirements, you can run it on a ServiceNav Box.

If you have more than one ServiceNav Box, the script should be deployed across all your ServiceNav Boxes.

Copy your file into the ServiceNav Box directory:


Assign execution and ownership permissions using the command lines:

chown nagios:nagios /usr/local/nagios/libexec/custom_plugin/
chmod 755 /usr/local/nagios/libexec/custom_plugin/.


Go to the ServiceNav interface and add a service:


Global-Plugin-ExecutionThe Plugin file to execute must contain the name of your file (previously placed in the directory as indicated above)

The Plugin arguments contains all the arguments of the plugin with the following caveats:

  • Arguments are passed in the form: -H 'value' or -host 'value' (example -c 'public' or -url '' )
  • To surround the values of the arguments, use the double-quote sign (" ) or the single-quote sign (').
  • If the value of an argument surrounded by double quotes contains a double quote it is necessary to escape it with " (backslash double quote)
  • If the value of an argument surrounded by single quotes contains a single quote it is necessary to escape it with ' ' (quote double quote quote double quote)

Example : -h $HOSTADDRESS$ –URI ‘mylogin.php’ –pwd ‘eyi "kim58’ –text ‘Rue de l' "‘ "‘alma’

Example: -h $HOSTADDRESS$ -URI 'mylogin.php' -pwd " eyi "kim58 " -text " Rue de l'alma "

The following variables can be used:

  • $_SERVICEHOSTALIAS$ returns the name of the host the service is linked with as displayed in ServiceNav
  • $HOSTADDRESS$ returns the IP address of the host the service is linked with as displayed in ServiceNav
  • $_SERVICEDISPLAYNAME$ returns the service name as specified in ServiceNav
  • $_SERVICEIDSERVICE$ returns the unique ServiceNav service ID
  • $_HOSTCOMPANYNAME$ returns the name of the company the host is associated with
  • $_HOSTHOST_CATEGORY_NAME$ returns the name of the ServiceNav host category the host associated with the service is assigned to

It is not possible to use inherited account variables specified at company and/or host level of ServiceNav. If the program requires any credential information, this should be specified in the field Plugin arguments.

This information is stored in encrypted form in the ServiceNav database but remains visible to anyone who has access to the service configuration page.

This may also be of interest to you

Global-Api-Value & Global-Api-Status

ps 1

Using generic PowerShell - GLOBAL-PS-Values models

Configuring a ServiceNav Box to receive traps


Welcome to ServiceNav!

Need help? More information about our products? Write to us!
You have taken note of our privacy policy.


While the epidemic lasts, ensure the availability and performance of your IT services for teleworking, with ServiceNav!

Following the government's call to mobilize to help businesses overcome the current health and economic context, we help you, free of charge, to ensure the complete monitoring of your teleworking environments: VPN, VDI, Teams, Skype Enterprise, Citrix... Objectives: collection, availability and usage indicators, dashboards to support your communication.
We use cookies to ensure that you have the best possible experience on our site, and if you continue to use this site, we will assume that you are satisfied with it.

Reserve your place

You have taken note of our privacy policy.