Show alerts on DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
oz123
Posts: 42
Joined: Thu Jun 09, 2011 10:21 am

Show alerts on DB

Post by oz123 »

Hi,

can you please provide me the select query for the Service Status online alerts where status not "OK" ?

Thanks
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Show alerts on DB

Post by abrist »

You can get this information from the backend api:

Code: Select all

http://<XI IP>/nagiosxi/backend/?cmd=getservicestatus&brevity=3&current_state=nin:0
Or from bash(query in quotes):

Code: Select all

echo "use nagios; select current_state,service_object_id,name1,name2 from nagios_servicestatus inner join nagios_objects on service_object_id=object_id where (current_state != 0)order by name1;" | mysql -t -pnagiosxi
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
oz123
Posts: 42
Joined: Thu Jun 09, 2011 10:21 am

Re: Show alerts on DB

Post by oz123 »

Thank you !!
Locked