Nagios monitor MySQL one error: nrpe:unable to read output specific resolution process

Source: Internet
Author: User

Introduction: Nagios interface. See Monitoring MySQL service errors, as below:

Warning:NRPE:Unable to read output

1, with the Nagios monitor server on the check

1.1. Run the Check_nrpe command for remote calls

Run Check_nrpe on the monitor side nagiosserver check for MySQL status errors such as the following:

[Email protected] ~]#/usr/lib/nagios/plugins/check_nrpe-h192.xx.180.xx-c check_mysql_status

Nrpe:unable to read output

You have new mail in/var/spool/mail/root

[Email protected] ~]#

1.2, check the service

Check other monitoring items on the nagiosserver side such as check_users, normal for example the following:

[Email protected] ~]#/usr/lib/nagios/plugins/check_nrpe-h192.xx.180.xx-c check_users

Users OK-2 users currently logged in |users=2;8;15;0

[Email protected] ~]#

Prove it here. The Nagios process is normal. Can detect other monitoring items such as check_users, but Check_mysql fault error, or need to go to the MySQLServer to analyze the problem exactly where.

2, on the monitored end Mysqlservercheck

2.1. Invokes the local Check_nrpe service. Report the same error as the following:

[email protected] ~]#/usr/lib/nagios/plugins/check_nrpe-hlocalhost-c check_mysql_status

Nrpe:unable to read output

[Email protected]mysqldb ~]#

Go to run the Check_mysql_status command inside/etc/nagios/nrpe.cfg alone.

First use cat to find Check_mysql command line

[Email protected]mysqldb ~]# cat/etc/nagios/nrpe.cfg |grep check_mysql_status

Command[check_mysql_status]=/usr/bin/sudo/usr/lib/nagios/plugins/check_mysql-unagios-p3306-s/usr/local/mysql/ Mysql.sock-hlocalhost--password= ' [email protected] '-D test

Run. The normal presentation sample is as follows:

[Email protected] mysqldb ~]#/usr/bin/sudo/usr/lib/nagios/plugins/check_mysql-unagios-p3306-s/usr/local /mysql/mysql.sock-hlocalhost--password= ' [email protected] '-D test

uptime:1122870 threads:108 questions:11559152 Slow queries:1278 opens:3190 Flush tables:1 Open tables:395 Qu Eries per second avg:10.294| connections=844188c;;; open_files=49;;; open_tables=395;;; qcache_free_memory=209024;;; qcache_hits=51724c;;; qcache_inserts=73877c;;; qcache_lowmem_prunes=5599c;;; qcache_not_cached=2572345c;;; qcache_queries_in_cache=1985;;; queries=11559153c;;; questions=10724833c;;; table_locks_waited=0c;;; threads_connected=107;;; threads_running=2;;; uptime=1122870c;;;

[Email protected] mysqldb ~]#

It is normal to be able to see the check_mysql script from here without problems.

2.2. Check the operating permissions of the Check_mysql

[email protected] ~]# ll/usr/lib/nagios/plugins/check_mysql

-rwxrwxr-x. 1 root root 168272 July 8 14:54/usr/lib/nagios/plugins/check_mysql

[email protected] ~]#

See is the last X that indicates that there is a run permission to sudo to the Nagios account. See if you can run it, such as the following:

[email protected] ~]# Su-nagios

-bash-4.1$/usr/lib/nagios/plugins/check_mysql-unagios-p3306-s/usr/local/mysql/mysql.sock-hlocalhost--password= ' [email protected] '-D test

uptime:1124403 threads:106 questions:11586454 Slow queries:1278 opens:3190 Flush tables:1 Open tables:395 Qu Eries per second avg:10.304| connections=846235c;;; open_files=49;;; open_tables=395;;; qcache_free_memory=211696;;; qcache_hits=51786c;;; qcache_inserts=73915c;;; qcache_lowmem_prunes=5732c;;; qcache_not_cached=2578541c;;; qcache_queries_in_cache=1890;;; queries=11586455c;;; questions=10750088c;;; table_locks_waited=0c;;; threads_connected=105;;; threads_running=2;;; uptime=1124403c;;;

-bash-4.1$

This shows that both the Naigos account and the Check_mysql script can be run, Check_mysql script path and run permissions are fine. are capable of.

2.3, check the Nagios permissions configuration on the inside of Sudo

Nagios remote invocation works by running all of the check_xxx scripts through the Nagios account. But my nrpeclient is installed on the root account. So the check_xxx script is also the root user, does Nagios run the su–root at the remote call, and then runs the check_msyql script command? So go to edit sudo configuration, change such as the following, stare defaults requiretty, and then add a row of Nagios all= (All) nopasswd:/usr/lib/nagios/plugins/check_mysql.

Vim/etc/sudoers


#表示不须要终端控制

#Defaults Requiretty

#表示通过nagios命令运行check_mysql命令不须要密码.

Nagios all= (All) nopasswd:/usr/lib/nagios/plugins/check_mysql

The changes are complete. wq! forcibly saves exiting vim Edit and then runs this check_npre operation check. Already resumed normal for example the following:

[email protected] ~]#/usr/lib/nagios/plugins/check_nrpe-hlocalhost-c check_mysql_status

uptime:1123659 threads:110 questions:11573270 Slow queries:1278 opens:3190 Flush tables:1 Open tables:395 Qu Eries per second avg:10.299| connections=845248c;;; open_files=49;;; open_tables=395;;; qcache_free_memory=227704;;; qcache_hits=51751c;;; qcache_inserts=73892c;;; qcache_lowmem_prunes=5656c;;; qcache_not_cached=2575554c;;; qcache_queries_in_cache=1943;;; queries=11573271c;;; questions=10737891c;;; table_locks_waited=0c;;; threads_connected=109;;; threads_running=2;;; uptime=1123659c;;;

Then go to the nagiosserver side to run the Check_nrpe check, normal for example:

[Email protected] ~]#/usr/lib/nagios/plugins/check_nrpe-h192.xx.180.xx-c check_mysql_status

uptime:1123673 threads:110 questions:11573464 Slow queries:1278 opens:3190 Flush tables:1 Open tables:395 Qu Eries per second avg:10.299| connections=845264c;;; open_files=49;;; open_tables=395;;; qcache_free_memory=227704;;; qcache_hits=51751c;;; qcache_inserts=73892c;;; qcache_lowmem_prunes=5656c;;; qcache_not_cached=2575596c;;; qcache_queries_in_cache=1943;;; queries=11573465c;;; questions=10738069c;;; table_locks_waited=0c;;; threads_connected=109;;; threads_running=2;;; uptime=1123673c;;;

[Email protected] ~]#

2.4, then go to the Nagios monitor interface and check that the MySQL option has returned to normal, for example as seen in:


3 comes with some other reasons

There are a number of reasons why the nrpe:unable to read output error has been caused by Google's other scenarios such as the following:

(1), the client configuration file/etc/nagios/npre.cfg does not include the Nagiosserverip address. For example Allowed_hosts=127.0.0.1,ip back IP is not filled out or filled in error.

(2), check whether the rights of Clientnrpe readable, can be run by Nagios, assuming that Nagios permissions are not enough. You need to give X operational permissions.

(3). Nrpe.cfg inside the commands command path is correct, for example, some of the existing RPM installation also has source code installation, the path is different, source code installation ngiosclient path is/usr/local/nagios/libexec/check_ MySQL, and the RPM package installation path is/usr/lib/nagios/plugins/check_mysql.

(4). The client configuration file has 2 identical commands in the face. For example,/ETC/NAGIOS/NRPE.CFG has the following 2 check_zombie_procs configuration commands:

Command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs-w 10-c 15-s Z
Command[check_zombie_procs]=/usr/lib/nagios/plugins/check_iostat-w

Then the error of nrpe:unable to read output will be reported. Because of the two orders chaos. I don't know which one to run.

From: http://blog.itpub.net/blog/post/id/1217246/

Article: http://blog.csdn.net/kakane/article/details/9615795

Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.

Nagios monitor MySQL one error: nrpe:unable to read output specific resolution process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.