/usr/share/doc/nagios-plugin-check-multi/examples/nagiostats.cmd is in nagios-plugin-check-multi 0.26-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #
# nagiostats.cmd
#
# checks Nagios performance and provides alarms and performance data
#
# Copyright (c) 2008-2009 Matthias Flacke (matthias.flacke at gmx.de)
#
# Call: check_multi -f nagiostats.cmd -s NSTATS=/path/to/nagiostats
#
# 1. check correct parameter passing for NSTAT binary
eval [ NSTATS_defined ] =
if (! "$NSTATS$") {
print "No '-s NSTATS=/path/to/nagiostats' defined\n";
exit 3;
}
# 2. check if passed binary is available and executable
eeval [ nagiostats_executable ] =
if ( ! -x "$NSTATS$") {
print "No nagiostats executable $NSTATS$ found\n";
exit 3;
} else {
"$NSTATS$";
}
# 3. checks
command [ host_number ] = $NSTATS$ -m -d NUMHOSTS
attribute [ host_number::warning ] = $host_number$ > 500
attribute [ host_number::critical ] = $host_number$ > 1000 || $host_number$ <= 0
command [ host_checks_5min_all ] = $NSTATS$ -m -d NUMACTHSTCHECKS5M
attribute [ host_checks_5min_all::warning ] = $host_checks_5min_all$ > 500
attribute [ host_checks_5min_all::critical ] = $host_checks_5min_all$ > 1000 || $host_checks_5min_all$ <= 0
command [ host_checks_5min_scheduled ] = $NSTATS$ -m -d NUMSACTHSTCHECKS5M
command [ host_checks_5min_ondemand ] = $NSTATS$ -m -d NUMOACTHSTCHECKS5M
command [ service_number ] = $NSTATS$ -m -d NUMSERVICES
attribute [ service_number::warning ] = $service_number$ > 2500 || $service_number$ <= 0
attribute [ service_number::critical ] = $service_number$ > 5000
command [ service_checks_5min_all ] = $NSTATS$ -m -d NUMACTSVCCHECKS5M
attribute [ service_checks_5min_all::warning ] = $service_checks_5min_all$ > 2500
attribute [ service_checks_5min_all::critical ] = $service_checks_5min_all$ > 5000 || $service_checks_5min_all$ <= 0
command [ service_checks_5min_scheduled ] = $NSTATS$ -m -d NUMSACTSVCCHECKS5M
command [ service_checks_5min_ondemand ] = $NSTATS$ -m -d NUMOACTSVCCHECKS5M
command [ host_latency_ms ] = $NSTATS$ -m -d AVGACTHSTLAT
attribute [ host_latency_ms::warning ] = $host_latency_ms$ > 2500 || $host_latency_ms$ <= 0
attribute [ host_latency_ms::critical ] = $host_latency_ms$ > 5000
command [ host_execution_time_ms ] = $NSTATS$ -m -d AVGACTHSTEXT
command [ service_latency_ms ] = $NSTATS$ -m -d AVGACTSVCLAT
attribute [ service_latency_ms::warning ] = $service_latency_ms$ > 2500 || $service_latency_ms$ <= 0
attribute [ service_latency_ms::critical ] = $service_latency_ms$ > 5000
command [ service_execution_time_ms ] = $NSTATS$ -m -d AVGACTSVCEXT
# 4. performance data
command [ perfdata::nagiostats ] = /bin/echo "OK|host_number=$host_number$ host_checks_5min_all=$host_checks_5min_all$ host_checks_5min_scheduled=$host_checks_5min_scheduled$ host_checks_5min_ondemand=$host_checks_5min_ondemand$ service_number=$service_number$ service_checks_5min_all=$service_checks_5min_all$ service_checks_5min_scheduled=$service_checks_5min_scheduled$ service_checks_5min_ondemand=$service_checks_5min_ondemand$ host_latency_ms=$host_latency_ms$ host_execution_time_ms=$host_execution_time_ms$ service_latency_ms=$service_latency_ms$ service_execution_time_ms=$service_execution_time_ms$"
|