我能够通过终端监控主机的包状态;但是 Nagios Web UI 给出了如下错误:
(No output returned from plugin)
这是有效的命令适当地通过终端:
/usr/lib/nagios/plugins/check_nrpe -H myhost -c check_apt
我的Nagios 服务描述检查 apt 更新:
define service {
hostgroup_name debian-servers
service_description Check apt updates
check_command check_nrpe!check_apt
use generic-service
normal_check_interval 5 ; Check the service every 10 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state $
notification_interval 0 ; set > 0 if you want to be renotified
contact_groups admins
}
顺便说一下,我的 Nagios 版本是3.2.3.
答案1
这是 debian/ubuntu,对吧?去看看/etc/nagios-plugins/config/check_nrpe.cfg
打包的 NRPE 插件有一个 conf,它定义check_nrpe
为需要额外的 ARG,并check_nrpe_1arg
定义为不需要 ARG 的检查:
# this command runs a program $ARG1$ with arguments $ARG2$
define command {
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
# this command runs a program $ARG1$ with no arguments
define command {
command_name check_nrpe_1arg
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
就我个人而言,我会重命名它们以避免混淆。(这会让很多人。
答案2
检查通过终端进行的事实证明被检查的主机上没有网络问题或服务问题。查看检查_nrpe命令定义,但是您可以通过设置来启用调试调试级别=256在你的nagios配置文件文件:
# This option determines how much (if any) debugging information will
# be written to the debug file. OR values together to log multiple
# types of information.
# Values:
# -1 = Everything
# 0 = Nothing
# 1 = Functions
# 2 = Configuration
# 4 = Process information
# 8 = Scheduled events
# 16 = Host/service checks
# 32 = Notifications
# 64 = Event broker
# 128 = External commands
# 256 = Commands
# 512 = Scheduled downtime
# 1024 = Comments
# 2048 = Macros
debug_level=256