Setup Command Management for check_json.pl
Posted: Tue Sep 08, 2015 12:25 pm
I'm new to Nagios XI , so I'm hoping someone can help me along on my first custom command check setup and then adding service for this command_check. It is for the check_json.pl plugin, which we already installed and confirmed that it is working from Nagios XI terminal session. I'm looking for steps on how to setup the command check properly for the check_json.pl plugin ( info below ) , any/all help is much appreciated, thanks. Really the command line * setup itself is confusing for this check -
check_json 0.5 [https://github.com/c-kr/check_json]
This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).
Nagios plugin to check JSON attributes via http(s)
Usage: check_json -u|--url <URL> -a|--attributes <attributes> [ -c|--critical <thresholds> ] [ -w|--warning <thresholds> ] [ -p|--perfvars <fields> ] [ -o|--outputvars <fields> ] [ -t|--timeout <timeout> ] [ -d|--divisor <divisor> ] [ -m|--metadata <content> ] [ -T|--contenttype <content-type> ] [ --ignoressl ] [ -h|--help ]
-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See http://nagiosplugins.org/extra-opts
for usage and examples.
-u, --url http://192.168.5.10:9332/local_stats
-a, --attributes {shares}->{dead},{shares}->{uptime}
-d, --divisor 1000000
-w, --warning INTEGER:INTEGER . See http://nagiosplug.sourceforge.net/devel ... HOLDFORMAT for the threshold format.
-c, --critical INTEGER:INTEGER . See http://nagiosplug.sourceforge.net/devel ... HOLDFORMAT for the threshold format.
-p, --perfvars eg. '* or {shares}->{dead},{shares}->{live}'
CSV list of fields from JSON response to include in perfdata
-o, --outputvars eg. '* or {status_message}'
CSV list of fields output in status message, same syntax as perfvars
-m|--metadata '{"name":"value"}'
RESTful request metadata in JSON format
-T, --contenttype application/json
Content-type accepted if different from application/json
--ignoressl
Ignore bad ssl certificates
-t, --timeout=INTEGER
Seconds before plugin times out (default: 15)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)
Example:
check_json.pl --url http://192.168.5.10:9332/local_stats --attributes '{shares}->{dead}' --warning :5 --critical :10 --perfvars '{shares}->{dead},{shares}->{live}' --outputvars '{status_message}'
check_json 0.5 [https://github.com/c-kr/check_json]
This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).
Nagios plugin to check JSON attributes via http(s)
Usage: check_json -u|--url <URL> -a|--attributes <attributes> [ -c|--critical <thresholds> ] [ -w|--warning <thresholds> ] [ -p|--perfvars <fields> ] [ -o|--outputvars <fields> ] [ -t|--timeout <timeout> ] [ -d|--divisor <divisor> ] [ -m|--metadata <content> ] [ -T|--contenttype <content-type> ] [ --ignoressl ] [ -h|--help ]
-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See http://nagiosplugins.org/extra-opts
for usage and examples.
-u, --url http://192.168.5.10:9332/local_stats
-a, --attributes {shares}->{dead},{shares}->{uptime}
-d, --divisor 1000000
-w, --warning INTEGER:INTEGER . See http://nagiosplug.sourceforge.net/devel ... HOLDFORMAT for the threshold format.
-c, --critical INTEGER:INTEGER . See http://nagiosplug.sourceforge.net/devel ... HOLDFORMAT for the threshold format.
-p, --perfvars eg. '* or {shares}->{dead},{shares}->{live}'
CSV list of fields from JSON response to include in perfdata
-o, --outputvars eg. '* or {status_message}'
CSV list of fields output in status message, same syntax as perfvars
-m|--metadata '{"name":"value"}'
RESTful request metadata in JSON format
-T, --contenttype application/json
Content-type accepted if different from application/json
--ignoressl
Ignore bad ssl certificates
-t, --timeout=INTEGER
Seconds before plugin times out (default: 15)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)
Example:
check_json.pl --url http://192.168.5.10:9332/local_stats --attributes '{shares}->{dead}' --warning :5 --critical :10 --perfvars '{shares}->{dead},{shares}->{live}' --outputvars '{status_message}'