Database value

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Enigmaal
Posts: 4
Joined: Thu Feb 22, 2018 8:03 am

Database value

Post by Enigmaal »

Hi everyone,

I'm actually trying to get data from Nagios' MySQL database and I got a little problem.
I would like get the state and the last date of result for a service but I don't know which tables get it.


Thank you

PS : Sorry for my not pretty good english , I'm from France , you even know baguette :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Database value

Post by tmcdonald »

We don't generally support custom queries into the database, but this will get you the columns you want:

Code: Select all

mysql> select current_state, last_check from nagios_servicestatus where service_object_id = 145;
+---------------+---------------------+
| current_state | last_check          |
+---------------+---------------------+
|             0 | 2018-02-26 11:00:02 |
+---------------+---------------------+
Figuring out which specific service_object_id to use will mean querying the nagios_services and nagios_hosts tables to get the relevant IDs to use.
Former Nagios employee
Locked