nagios 安装配置(5)——check_nrpe传参

现象:

监控主机:

[root@xxx ~]# /usr/local/nagios/libexec/check_nrpe -H 2.xx.xx.xx -c  check_pingtest  -a " -H 1.2.3.4   -w 150,30%  -c 200,50% -p 5"

CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.

被监控主机

tail -f /var/log/messages

Jun  5 07:41:31 xxx nrpe[10807]: Error: Request contained command arguments!

Jun  5 07:41:31 xxx nrpe[10807]: Client request was invalid, bailing out...

解决:

被监控主机:

  1. 重新编译安装nrpe 带这个参数 --enable-command-args ; make all ;make install    #####allows clients to specify command arguments.  *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!
  2. /usr/local/nagios/etc/nrpe.cfg : dont_blame_nrpe=1 #打开参数传递
  3. 编辑 /usr/local/nagios/etc/nrpe.cfg : command[check_pingtest]=/usr/local/nagios/libexec/check_ping -H $ARG1$ -w 1500,100%  -c 2000,100% -p  $ARG2$  -t  10

监控主机

  1. 测试:[root@xxx ~]# /usr/local/nagios/libexec/check_nrpe -H 2.xx.xx.xx -c  "check_pingtest"  -a 1.2.3.4  10 
  2. 结果:PING OK - Packet loss = 0%, RTA = 53.43 ms|rta=53.426998ms;1500.000000;2000.000000;0.000000 pl=0%;100;100;0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值