mvi*_*lar 1 bash nagios nrpe shell-scripting
我正在 nagios 服务器上使用 nagios 和 nrpe 监视 NTP 服务器,当我收到以下错误时:服务状态未知状态信息我缺少一个重要组件:bash
该插件是:http : //archive.groundworkopensource.com/groundwork-opensource/trunk/monitor-core/nagios/plugins-contrib/check_procr.sh
我这样做时的输出bash -x check_procr.sh是:
+ myself=check_procr
+ verify_dep
+ needed='bash cut egrep expr grep let ps sed sort tail test tr wc'
++ echo bash cut egrep expr grep let ps sed sort tail test tr wc
+ for i in '`echo $needed`'
+ type bash /dev/null
+ '[' 1 -eq 1 ']'
+ echo 'I am missing an important component : bash'
I am missing an important component : bash
+ echo 'Cannot continue, sorry, try to find the missing one...'
Cannot continue, sorry, try to find the missing one...
+ exit 3
Run Code Online (Sandbox Code Playgroud)
提前致谢
编辑函数verify_dep(),使行
type $i > /dev/null 2>&1 /dev/null
Run Code Online (Sandbox Code Playgroud)
改为
type $i > /dev/null 2>&1
Run Code Online (Sandbox Code Playgroud)
之后,它应该可以工作。原始行是错误的,并且总是导致错误。