1
0
mirror of https://github.com/c-kr/check_json.git synced 2024-11-24 03:13:50 +01:00
check_json_fork/README.md

33 lines
1.5 KiB
Markdown
Raw Normal View History

2022-03-07 17:44:34 +01:00
This fork is currently unmaintained. Please use one of the other forks for a better experience (e.g. https://github.com/asymworks/check_json)
2013-04-28 18:23:25 +02:00
check_json
==========
2013-04-28 18:39:35 +02:00
Nagios plugin to check JSON attributes via http(s).
This Plugin is a fork of the existing JSON Plugin from https://github.com/bbuchalter/check_json with the enhancements of using the Nagios::Plugin Perl Module, allowing to use thresholds and performance data collection from various json attributes.
2013-04-28 18:39:35 +02:00
Performance data is also enhanced to extract performance data compliant to Nagios and Graphite standards. One attribute is selected for thresholds check, multiple others can be added for extracting performance data. This plugin is aimed at simplifying Nagios, Icinga & Icinga2 polling of JSON status APIs.
Usage:
```
check_json -u|--url <URL> -a|--attribute <attribute> [ -c|--critical <threshold> ] [ -w|--warning <threshold> ] [ -p|--perfvars <fields> ] [ -o|--outputvars <fields> ] [ -t|--timeout <timeout> ] [ -d|--divisor <divisor> ] [ -T|--contenttype <content-type> ] [ --ignoressl ] [ -h|--help ]
```
2013-04-28 18:39:35 +02:00
Example:
```
./check_json.pl --url http://192.168.5.10:9332/local_stats --attribute '{shares}->{dead_shares}' --warning :5 --critical :10 --perfvars '{shares}->{dead_shares},{shares}->{live_shares},{clients}->{clients_connected}'
```
2013-04-28 18:39:35 +02:00
Result:
```
Check JSON status API OK - dead_shares: 2, live_shares: 12, clients_connected: 234 | dead_shares=2;5;10 live_shares=12 clients_connected=234
```
2013-04-28 19:07:27 +02:00
Requirements
============
Perl JSON package
* Debian / Ubuntu : libjson-perl libnagios-plugin-perl libwww-perl