status-txt: easier for other applications/services to use Nagios data
Wenhua Zhang
shiziwen at gmail.com
Thu May 3 05:57:13 CEST 2012
Hi all,
Recently, we need a API or application to get the nagios data as other
easily readable format such as XML, JSON or plain text instead of the
default HTML.
status-txt is implemented to duplicate the output of status.cgi in
plain text to achieve this goal, making it easier for other
applications/services to use Nagios data.
Compile status-txt.c to create status-txt.cgi, this cgi accepts
exactly the same URL parameters that status.cgi accepts, and filters
its output appropriately.
In this version, it accepts almost all the arguments passed in the URL
which status.cgi accepts except "style", "navbarsearch", "columns" and
"noheader".
And we will add more functionalities in the next version.
The status-txt.cgi will returns service data that appears in the
"status" table of status.cgi as "host_ip host_status
[service:service_status;......]", not includes the top portion of the
page, eg:
196.0.0.1 UP HTTP_80:OK;
196.0.0.2 UP DB_PORT_3306:OK;DB_PORT_3307:OK;
And you can use some arguments to filter its output, such as
"hostgroup", "servicegroup", "host" and so on.
The attachment is the source code, if you have any ideas about it,
please feel free to let me know.
You can also get the source code from github
"https://github.com/shiziwen/nagios-status2txt".
Thanks,
Best Wishes,
Wenhua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: status-txt.c
Type: text/x-csrc
Size: 25918 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120503/7487332a/attachment.c>
-------------- next part --------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list