Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
It all depends what you called the service check. This is usually not support that we provide as it is a custom solution for a specific setup. You should spend a bit of time getting acquainted with mysql and the syntax of queries. Start with the following documentation: http://dev.mysql.com/doc/
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.
mysql> select output from nagios_servicestatus;
+--------------------------------------------------------------------+
| output |
+--------------------------------------------------------------------+
| PROCS OK: 106 processes with STATE = RSZDT |
| SSH OK - OpenSSH_5.3 (protocol 2.0) |
| SWAP OK - 100% free (4031 MB out of 4031 MB) |
| PING OK - Packet loss = 0%, RTA = 0.05 ms |
| DISK OK - free space: / 10828 MB (72% inode=88%): |
| USERS OK - 2 users currently logged in |
| HTTP OK: HTTP/1.1 200 OK - 265 bytes in 0.011 second response time |
| OK - load average: 0.24, 0.05, 0.02 |
+--------------------------------------------------------------------+
8 rows in set (0.00 sec)
and it is ok, but which select command I hate to use if I want only the one of these lines?
For example, I need only check_load line (in this case is the last), is it possible to have a select command that has as result only one of these lines?
How becomes the select command in that case?
It should always remain the same. Your not going to get a ton of basic SQL support here but one thing you could do is something like this, replacing localhost and Ping with what you are looking for
select nagios_servicestatus.output from nagios_servicestatus, nagios_objects where nagios_servicestatus.service_object_id=nagios_objects.object_id and nagios_objects.name1='localhost' and nagios_objects.name2='Ping';