Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
A wizard to create checks that monitor values returned in a web service's JSON response.
Current Version
1.2.1
Last Release Date
2019-11-04
Owner
Craig Dienger
Compatible With
1.2.1 ------ -verbiage added -String check statuses changed from fields to drop downs
1.2 ------ -Added service field -Fixed some logic -Cleaned up code a bit
1.1.1 ------ -string can be regex OR exact match
1.1.0: ------- - string can take regex(https://www.php.net/manual/en/function.preg-match.php) - -x option added. Allows one to specify a return_key. Previously and by default it would return the value specified with -k. Now you can check a key (-k [key]) and return a different key (-x [return_key])
php /usr/local/nagios/libexec/check_json.php -u "http://cve.circl.lu/api/last" -k "0.summary" -s /.*microsoft.*/i -r 2 -n 0 -h "" -x 0.id
1.0.5: -------
To run the plugin to evaluate a numeric value:
php /usr/local/nagios/libexec/restful.php -u [url] -k [key] -w [warning threshold] -c [critical threshold] -h [additional optional header]
Strings:
php /usr/local/nagios/libexec/restful.php -u [url] -k [key] -s [string to match] -r [return code to return if string matches key value] -n [return code to return if string value does not match key value] -h [additional optional header]
To illustrate the format of the key, take these examples:
Say we want to make sure Leanne and Kurtis don't stray too far longitudinally. We'd run something like:
php restful.php -w 81:82 -c 80:83 -k 0.address.geo.lng -u https://jsonplaceholder.typicode.com/users
php restful.php -w 81:82 -c 80:83 -k 6.address.geo.lng -u https://jsonplaceholder.typicode.com/users
and say we want to make sure their usernames are not changed:
php restful.php -k 0.username -u https://jsonplaceholder.typicode.com/users -s lgraham -r 0 -n 2
php restful.php -k 6.username -u https://jsonplaceholder.typicode.com/users -s Elwyn.Skiles -r 0 -n 2
I've found Firefox to be pretty useful in helping to identify the structure of a JSON file and find the key I'm interested in.
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!