-
Notifications
You must be signed in to change notification settings - Fork 9
Livestatus cgi
LiveStatus is the interface to query the nagios system for data about the monitoring system. The API documented here uses a CGI interface to access all the nagios backends to be able to query across all the nagios instances. For more info on the LiveStatus netsocket implementation see http://mathias-kettner.de/checkmk_livestatus.html
The CGI uses the Monitoring::Livestatus module. More information about this module can be found here: http://search.cpan.org/~nierlein/Monitoring-Livestatus-0.64/lib/Monitoring/Livestatus.pm
The Nag ui interface that uses livestatus can be accessed here: http://--yourwebhost--/nagiu/
The CGI is here:
http://--yourwebhost--/nagiu/nagios_live.cgi
the parameters to query via the CGI are as follows:
query = this is a query in LQL (see livestatus site listed above) but using the 'pipe' | character instead of linefeeds nagios_server = this will cause the query to only be executed against the specified nagios server. this value is the 'tag' or 'peer name' of the server (this tag is added to all entries returned from the livestatus) as defined in the nagui.conf file groupby = this value should be the name of a key in the data set returned that you would like the results summarized by. This is useful for getting total counts of stats across datacenters. Since each 'Stat' in LQL will return a separate record for each datacenter. The data returned from the CGI is in JSON format
Example:
wget 'https://<username>:<password>@<yourwebhost/nagiu/nagios_live.cgi?query=GET services|Filter: state = 2|Filter: state = 1|Or: 2|Columns: host_name host_address description plugin_output notes host_notes|Filter: description ~ ^WebServer' -O -