[root@mysqlvm2 ~]# /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 Queries 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;;;
[root@mysqlvm2 ~]#
2.4,再去nagios监控界面,查看mysql选项已经恢复正常,如下图所示:
3 附带一些其他原因
引起NRPE: Unable to read output报错的原因有很多种,google了下其它的情况如下:
(1),客户端配置文件/etc/nagios/npre.cfg里面没有添加nagios服务器IP地址,比如 allowed_hosts=127.0.0.1,IP后面IP没有填写或者填写有误。
(2),查客户端nrpe的权限是否可读,可被nagios执行,如果nagios权限不够,需要赋予X可执行权限。
(3),nrpe.cfg里面commands命令路径是否正确,比如有些既有rpm方式安装的也有源码安装的,两者路径不一样,源码安装ngios客户端路径是/usr/local/nagios/libexec/check_mysql,而rpm包安装路径是/usr/lib/nagios/plugins/check_mysql。
在RHEL5.3上配置基本的Nagios系统(使用Nagios-3.1.2)
CentOS 5.5+Nginx+Nagios监控端和被控端安装配置指南
Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用