Nagios NRPE插件对返回字符串的识别问题
时间:2011-12-23
来源:互联网
NRPE的配置文件里添加的command定义如下:
command[test_command]=/usr/local/nagios/libexec/test_command
这台机器是被监控的,在控制台出现以下情况:
----------------------------------------------
[root@centos6 libexec]# pwd
/usr/local/nagios/libexec
[root@centos6 libexec]# cat test_command
# !/bin/sh
REHEAD=$(clock)
echo "${REHEAD} ~12345"
exit 1
[root@centos6 libexec]# ./test_command
Thu 22 Dec 2011 06:50:24 PM CST -0.063304 seconds ~12345
[root@centos6 libexec]# ./check_nrpe -H localhost -c test_command
~12345
[root@centos6 libexec]#
----------------------------------------------
感觉在shell里面执行的命令返回出来的信息和直接echo出来的信息,对check_nrpe这个插件来说有些不一样。
求高手解释原因。
____________________________________
然后我试验直接在command的定义里面写命令形式:
command[direct_command]=/sbin/clock
调用check_nrpe的时候出现以下错误:
------------------------------------
[root@centos6 libexec]# /sbin/clock
Fri 23 Dec 2011 02:23:57 PM CST -0.173109 seconds
[root@centos6 libexec]# ./check_nrpe -H localhost -c direct_command
NRPE: Unable to read output
[root@centos6 libexec]#
------------------------------------
command[test_command]=/usr/local/nagios/libexec/test_command
这台机器是被监控的,在控制台出现以下情况:
----------------------------------------------
[root@centos6 libexec]# pwd
/usr/local/nagios/libexec
[root@centos6 libexec]# cat test_command
# !/bin/sh
REHEAD=$(clock)
echo "${REHEAD} ~12345"
exit 1
[root@centos6 libexec]# ./test_command
Thu 22 Dec 2011 06:50:24 PM CST -0.063304 seconds ~12345
[root@centos6 libexec]# ./check_nrpe -H localhost -c test_command
~12345
[root@centos6 libexec]#
----------------------------------------------
感觉在shell里面执行的命令返回出来的信息和直接echo出来的信息,对check_nrpe这个插件来说有些不一样。
求高手解释原因。
____________________________________
然后我试验直接在command的定义里面写命令形式:
command[direct_command]=/sbin/clock
调用check_nrpe的时候出现以下错误:
------------------------------------
[root@centos6 libexec]# /sbin/clock
Fri 23 Dec 2011 02:23:57 PM CST -0.173109 seconds
[root@centos6 libexec]# ./check_nrpe -H localhost -c direct_command
NRPE: Unable to read output
[root@centos6 libexec]#
------------------------------------
作者: xumeng1215 发布时间: 2011-12-23
很明显是nagios那些控制文件个人觉得是都变成2进制的文件了,你直接上面修改,肯定不行的
作者: fengyunsen4 发布时间: 2011-12-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28