Hi all! Does anybody use subj?
I get NULL everytime from that plugin. Here are my configs
define command{.
command_name<-->check_mysql_query
command_line<-->$USER1$/check_mysql_query -H a.b.c.d -P 3306 -d database -u user -p password -q 'SELECT COUNT(`post_name`) FROM wp_posts;' -w $ARG1$ -c $ARG2$
}.
define service{
<------>use<---><------><------>generic-service
<------>host_name<-----><------>server
<------>service_description<--->costs
<------>check_command<-><------>check_mysql_query!10!20
<------>}
When I run command from cmd everything is ok and I get
usr/lib64/nagios/plugins/check_mysql_query H a.b.c.d -P 3306 -d database -u user -p password -q 'SELECT COUNT(`post_name`) FROM wp_posts;' -w 1 -c 2
QUERY CRITICAL: 'SELECT COUNT(`post_name`) FROM wp_posts;' returned 36,000000
Where is the problem?
check_mysql_query
Re: check_mysql_query
I need to ask the obvious question here, but are you actually putting <-----> in your configs?
Former Nagios employee
Re: check_mysql_query
Not. I use mc, and <--> appear when I insert code there.I need to ask the obvious question here, but are you actually putting <-----> in your configs?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: check_mysql_query
The first troubleshooting step will be to try to run the same command from the cli while logged on as the nagios user.
Please try that and report back the results.
Please try that and report back the results.
Re: check_mysql_query
-bash-4.1$ /usr/lib64/nagios/plugins/check_mysql_query -H a.b.c.d -P 3306 -d database -u user -p password -q 'SELECT COUNT(`post_name`) FROM wp_posts;' -w 10 -c 20
QUERY CRITICAL: 'SELECT COUNT(`post_name`) FROM wp_posts;' returned 36,000000
When it run from the cli while logged as the nagios user everything looks fine with result.
QUERY CRITICAL: 'SELECT COUNT(`post_name`) FROM wp_posts;' returned 36,000000
When it run from the cli while logged as the nagios user everything looks fine with result.
Re: check_mysql_query
By chance do you have any special characters in your password?
Former Nagios Employee.
me.
me.
Re: check_mysql_query
I had, but now changed the password, and nothing happens. In cli `ok`, nagios has 'null'hsmith wrote:By chance do you have any special characters in your password?
Re: check_mysql_query
What is the output of a grep '$USER1' /usr/local/nagios/etc/resource.cfg command?
Former Nagios Employee.
me.
me.
Re: check_mysql_query
$USER1$=/usr/lib64/nagios/pluginshsmith wrote:What is the output of a grep '$USER1' /usr/local/nagios/etc/resource.cfg command?
Re: check_mysql_query
Can you run a 'pre flight check?' /usr/lib64/nagios/bin/nagios -v /usr/lib64/nagios/etc/nagios.cfg
If that doesn't work, my paths may be slightly off. I am not used to that directory structure. How did you install Nagios? What OS is it running on?
If that doesn't work, my paths may be slightly off. I am not used to that directory structure. How did you install Nagios? What OS is it running on?
Former Nagios Employee.
me.
me.