eventhandler configuration on nagios XI
Posted: Thu Jun 12, 2025 8:36 am
Hello,
I need your help to configure an "eventhandler" on nagios XI . I have a script that allows to start a telnet service in case this service stops.
my working environment is: nagios XI 2024 and telnet runs on windows 2012 R2 . the command was created correctly and works with command-check but when I program it in eventhandler the following error message is displayed:
Usage: check_ncpa.py [options]
Options:
-h, --help show this help message and exit
-H HOSTNAME, --hostname=HOSTNAME
The hostname to be connected to.
-M METRIC, --metric=METRIC
The metric to check, this is defined on client system.
This would also be the plugin name in the plugins
directory. Do not attach arguments to it, use the -a
directive for that. DO NOT INCLUDE the api/
instruction.
-P PORT, --port=PORT Port to use to connect to the client.
-w WARNING, --warning=WARNING
Warning value to be passed for the check.
-c CRITICAL, --critical=CRITICAL
Critical value to be passed for the check.
-u UNITS, --units=UNITS
The unit prefix (k, Ki, M, Mi, G, Gi, T, Ti) for b and
B unit types which calculates the value returned.
-n UNIT, --unit=UNIT Overrides the unit with whatever unit you define. Does
not perform calculations. This changes the unit of
measurement only.
-a ARGUMENTS, --arguments=ARGUMENTS
Arguments for the plugin to be run. Not necessary
unless you're running a custom plugin. Given in the
same as you would call from the command line. Example:
-a '-w 10 -c 20 -f /usr/local'
-t TOKEN, --token=TOKEN
The token for connecting.
-T TIMEOUT, --timeout=TIMEOUT
Enforced timeout, will terminate plugins after this
amount of seconds. [55]
-d, --delta Signals that this check is a delta check and a local
state will kept.
-l, --list List all values under a given node. Do not perform a
check.
-v, --verbose Print more verbose error messages.
-D, --debug Print LOTS of error messages. Used mostly for
debugging.
-V, --version Print version number of plugin.
-q QUERYARGS, --queryargs=QUERYARGS
Extra query arguments to pass in the NCPA URL.
-s, --secure Require successful certificate verification. Does not
work on Python < 2.7.9.
-p, --performance Print performance data even when there is none. Will
print data matching the return code of this script
the command is:
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'NAG' -P 5693 -M plugins/ScriptRedemarrageServiceWindows.ps1
I need your help to configure an "eventhandler" on nagios XI . I have a script that allows to start a telnet service in case this service stops.
my working environment is: nagios XI 2024 and telnet runs on windows 2012 R2 . the command was created correctly and works with command-check but when I program it in eventhandler the following error message is displayed:
Usage: check_ncpa.py [options]
Options:
-h, --help show this help message and exit
-H HOSTNAME, --hostname=HOSTNAME
The hostname to be connected to.
-M METRIC, --metric=METRIC
The metric to check, this is defined on client system.
This would also be the plugin name in the plugins
directory. Do not attach arguments to it, use the -a
directive for that. DO NOT INCLUDE the api/
instruction.
-P PORT, --port=PORT Port to use to connect to the client.
-w WARNING, --warning=WARNING
Warning value to be passed for the check.
-c CRITICAL, --critical=CRITICAL
Critical value to be passed for the check.
-u UNITS, --units=UNITS
The unit prefix (k, Ki, M, Mi, G, Gi, T, Ti) for b and
B unit types which calculates the value returned.
-n UNIT, --unit=UNIT Overrides the unit with whatever unit you define. Does
not perform calculations. This changes the unit of
measurement only.
-a ARGUMENTS, --arguments=ARGUMENTS
Arguments for the plugin to be run. Not necessary
unless you're running a custom plugin. Given in the
same as you would call from the command line. Example:
-a '-w 10 -c 20 -f /usr/local'
-t TOKEN, --token=TOKEN
The token for connecting.
-T TIMEOUT, --timeout=TIMEOUT
Enforced timeout, will terminate plugins after this
amount of seconds. [55]
-d, --delta Signals that this check is a delta check and a local
state will kept.
-l, --list List all values under a given node. Do not perform a
check.
-v, --verbose Print more verbose error messages.
-D, --debug Print LOTS of error messages. Used mostly for
debugging.
-V, --version Print version number of plugin.
-q QUERYARGS, --queryargs=QUERYARGS
Extra query arguments to pass in the NCPA URL.
-s, --secure Require successful certificate verification. Does not
work on Python < 2.7.9.
-p, --performance Print performance data even when there is none. Will
print data matching the return code of this script
the command is:
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'NAG' -P 5693 -M plugins/ScriptRedemarrageServiceWindows.ps1