Page 1 of 1

MYSQL NRPE: Unable to read output

Posted: Tue Jan 20, 2015 12:30 pm
by jwahl
Hi there,

I have the following output from one my my hosts I've just set up for monitoring.

/ Disk Usage Ok 3d 21h 40m 40s 1/5 2015-01-20 10:23:11 DISK OK - free space: / 85196 MB (72% inode=92%):
Apache Web Server Ok 3d 21h 40m 19s 1/5 2015-01-20 10:23:57 (No output returned from plugin)
CPU Stats Ok 3d 21h 39m 46s 1/5 2015-01-20 10:19:37 CPU STATISTICS OK: user=0.21% system=0.01% iowait=0.00% idle=99.77%
Cron Scheduling Daemon Ok 3d 21h 39m 9s 1/5 2015-01-20 10:20:07 crond (pid 1469) is running...
Load Ok 3d 21h 38m 51s 1/5 2015-01-20 10:20:37 OK - load average: 0.01, 0.03, 0.00
Memory Usage Ok 3d 21h 38m 24s 1/5 2015-01-20 10:20:48 OK - 5593 / 6144 MB (91%) Free Memory, Used: 2230 MB, Shared: 0 MB, Buffers: 0 MB, Cached: 1679 MB
MySQL Server Critical 3d 21h 38m 3s 5/5 2015-01-20 10:23:19 NRPE: Unable to read output
Open Files Ok 3d 21h 37m 21s 1/5 2015-01-20 10:22:06 OK: 2368 open files (0% of max 524288)
Ping Ok 3d 21h 37m 0s 1/5 2015-01-20 10:22:37 OK - 64.64.24.63: rta 48.576ms, lost 0%
SSH Server Ok 3d 21h 36m 45s 1/5 2015-01-20 10:22:47 openssh-daemon (pid 2135) is running...
Swap Usage Critical 3d 21h 36m 0s 5/5 2015-01-20 10:22:27 SWAP CRITICAL - 0% free (0 MB out of 0 MB) - Swap is either disabled, not present, or of zero size.
Total Processes Ok 3d 21h 40m 34s 1/5 2015-01-20 10:23:26 PROCS OK: 72 processes
Users Warning 23h 50m 17s 5/5 2015-01-20 10:23:34 USERS WARNING - 6 users currently logged in
Yum Updates Warning 3d 21h 39m 32s 5/5 2015-01-20 10:23:41 YUM WARNING: O/S requires an update.

As you can see the MySQL server is returning NRPE: Unable to read output, but most everything else seems like it's communicating as expected(with the exception of the Apache web server but I'll deal with that later).

On the nagios server, in the file /usr/local/nagios/etc/nrpe.cfg I have the following:

command[check_myql]=/usr/local/nagios/libexec/check_mysql -H <host> -u'<user>' -p'<pass>'

I can su nagios and then paste the full command and get an appropriate response from the <host>. I'm not sure what's going on here??? Any ideas?

Re: MYSQL NRPE: Unable to read output

Posted: Tue Jan 20, 2015 4:34 pm
by slansing
So is there a particular reason that you added that command to your XI server's local nrpe.cfg? And furthermore, are trying to execute that check with NRPE? I could maybe see why you'd want to execute it on a remote host to talk to another host that is behind a firewall or something like that. But why not just set up a basic nagios command to call your check_mysql plugin on the XI server? Since it accepts a host address, you can run it completely locally.

Re: MYSQL NRPE: Unable to read output

Posted: Wed Jan 21, 2015 1:07 pm
by jwahl
slansing wrote:So is there a particular reason that you added that command to your XI server's local nrpe.cfg?
Just troubleshooting since it didn't work by default.
slansing wrote: And furthermore, are trying to execute that check with NRPE?
I don't know - how can I tell?
slansing wrote: I could maybe see why you'd want to execute it on a remote host to talk to another host that is behind a firewall or something like that.
The remote host is most definitely behind a firewall but there are rules in place to allow traffic from the Nagios server
slansing wrote: But why not just set up a basic nagios command to call your check_mysql plugin on the XI server? Since it accepts a host address, you can run it completely locally.
Isn't the command /usr/local/nagios/libexec/check_mysql -H <host> -u'<user>' -p'<pass>' running locally on the nagios server?

Is there an example you can point me to if this isn't the proper way?

Re: MYSQL NRPE: Unable to read output

Posted: Wed Jan 21, 2015 5:26 pm
by slansing
Well you provided NRPE output as well as this:
On the nagios server, in the file /usr/local/nagios/etc/nrpe.cfg I have the following:

command[check_myql]=/usr/local/nagios/libexec/check_mysql -H <host> -u'<user>' -p'<pass>'
Which made me think that you are trying to call check_mysql through a check_nrpe command in XI, if this is not the case please let me know. If it is, I would highly recommend just using the plugin itself, without messing around with NRPE at all, as that is not required for this plugin. You could instead just define the XI check command to call check_mysql, or use one of they mysql check wizards. Please let me know if any of my previous assumptions were incorrect in your case.