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.
I would like to run query checks on all of our MySQL servers. I am using the check_mysql_plugin. I want to run it from the Nagios server and NOT through NRPE.
Running the plugin through NRPE runs the plugin fine. Running the plugin manually on the server runs fie. However when I try to run it through the actual Nagios app, it returns a NULL value. Permissions for the plugin look fine too, especially since I can run them as both root and the nagios user.
The command is as follows in my commands.cfg file:
# check_avgwebusers
define service{
use generic-service
host_name mysql
service_description Check Avg Web Server Users
check_command check_avgwebusers
}
Any thoughts? I am TOTALLY stumped right now. Any help would be appreciated. Thanks!
I'd verify that those warning and critical values do work with the plugin "through the manpage" and that those are values that would be true when running the query you show.
QUERY OK: 'SELECT COUNT(*)/COUNT(DISTINCT(Server)) FROM WebSessions;' returned 30.285700
So as you can see, the plugin runs just fine. Just for some reason won't return a value to Nagios. However if I run it through NRPE, it returns the value (but this isn't what I want to do).
I rearranged them like you said, but I am still getting a NULL value. It's just not making any sense why it works if I run it manually, but not when Nagios runs it.
BTW, if I run this through NRPE, it works fine. However, I don't want to run it through NRPE. I want to be able to run it on the server and generate a custom notification based on its results.
# check_avgwebusers
define service{
use generic-service
host_name mysql
service_description Check Avg Web Server Users
check_command check_avgwebusers
}