JSON

status-json

Description:

status-json duplicates the output of status.cgi in JSON format to make it easier for other applications/services to use Nagios data.

To compile:
1. Copy status-json.c into $NAGIOS_DIR/cgi/
2. cd $NAGIOS_DIR/cgi/
3. Execute the command below to compile status-json.c into status-json.cgi
gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI -o status-json.cgi status-json.c getcgi.o cgiutils.o cgiauth.o macros-cgi.o skiplist.o objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../common/shared.o

Updated 7 March 2012: Thanks to Doychin Atanasov for making some changes to fix problems with honoring disabled notifications and acknowledged states.

Updated 6 March 2017: Thanks to everyone who has used status-json, or who has made improvements to it, or who has had questions about it. We’re no longer using Nagios at my site, so I am not able to promise ongoing support for status-json. I’ve updated the source to include instructions for compiling status-json with gcc.

Current Version

2.0

Last Release Date

2012-03-06

Compatible With

  • Nagios 3.x

Owner

License

GPL


Project Files
Project Notes
status-json duplicates the output of status.cgi in JSON format. Compile status-json.c to create status-json.cgi. status-json.cgi accepts exactly the same URL parameters that status.cgi accepts, and filters its output appropriately. To compile: 1. Copy status-json.c into $NAGIOS_DIR/cgi/ 2. cd $NAGIOS_DIR/cgi/ 3. Execute the command below to compile status-json.c into status-json.cgi gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI -o status-json.cgi status-json.c getcgi.o cgiutils.o cgiauth.o macros-cgi.o skiplist.o objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../common/shared.o Note that status-json.cgi only returns the service/host/servicegroup/hostgroup data that appears in the "status" table of status.cgi. It does not return the top portion of the page. I will add this functionality in the next version. Updated 7 March 2012: Thanks to Doychin Atanasov for making some changes to fix problems with honoring disabled notifications and acknowledged states. Updated 6 March 2017: Thanks to everyone who has used status-json, or who has made improvements to it, or who has had questions about it. We're no longer using Nagios at my site, so I am not able to promise ongoing support for status-json. I've updated the source to include instructions for compiling status-json with gcc.
Reviews (1) Add a Review
greate tool
by skipper, August 31, 2016

Here is the way to compile it (could be useful): cd ./nagios-3.2.3/ ./configure make all cd ./cgi gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI -o status-json.cgi status-json.c getcgi.o cgiutils.o cgiauth.o macros-cgi.o skiplist.o objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o



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
5 (2)
Favorites
1
Views
115,360