Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
status-json
2.0
2012-03-06
- Nagios 3.x
GPL
115331
File | Description |
---|---|
status-json.c | status-json.c source code with D. Atansov's bug fix |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
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.
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.
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)
byskipper, August 11, 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
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