10 月 292014
 

检测多路径数量状态
[root@rtmp01 libexec]# ./check_multipath.pl -m 1 -o 2
OK
LUN mpathc: 2/2.
[root@rtmp01 libexec]#

执行multipath需root权限

修改NRPE配置文件
# command_prefix=/usr/bin/sudo
command_prefix=/usr/bin/sudo

修改sudoer配置文件
#Defaults    requiretty

nagios  ALL=(ALL)       NOPASSWD: ALL

保持nagios用户为可登录状态
/etc/passwd
/bin/bash

错误分析一
[root@monitor libexec]# ./check_nrpe -H 192.168.155.114 -c check_multipath

ERROR: Command failed, ‘sudo’ not configured for command: ‘/sbin/multipath -l’? |Host: rtmp01|
[root@monitor libexec]#

错误分析二
[root@monitor libexec]# ./check_nrpe -H 192.168.155.114 -c check_multipath
NRPE: Unable to read output
[root@monitor libexec]# ./check_nrpe -H 192.168.155.114 -c check_multipath
OK<br/>LUN mpathc: 2/2.<br/>
[root@monitor libexec]#

定义命令
command[check_multipath]=/usr/local/nagios/libexec/check_multipath.pl -m 1 -o 2

定义服务
define service{
use                             generic-service
host_name                       rtmp01
service_description             Multipath Status
check_command                   check_nrpe!check_multipath
}

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据