大龙的博客

常用链接

统计

最新评论

Nagios 的参数传递

    • 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.

近端查看日志发现:/var/log/message 

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
  4. 服务端测试:[root@xxx ~]# /usr/local/nagios/libexec/check_nrpe -H 2.xx.xx.xx -c  "check_pingtest"  -a 1.2.3.4  10 
  5. 测试ok 返回结果:PING OK - Packet loss = 0%, RTA = 53.43 ms|rta=53.426998ms;1500.000000;2000.000000;0.000000 pl=0%;100;100;0
Note:ping 结果可能不一样 因为checkping 版本不一样

posted on 2011-10-28 12:42 大龙 阅读(1854) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理