Websites, Forms and Transactions

JSON Wizard

Description:

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

Compatible With

  • Nagios XI

Project Files
Project Photos
Project Notes
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: ------- A wizard to create checks that monitor values returned in a web service's JSON response. 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.
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
9,235