标签:nrpe nrpe: unable to read output
在客户端编写的一个脚本check_ssh_auto.sh
#!/bin/bash
a=`/bin/cat /etc/ssh/sshd_config | grep PasswordAuthentication | grep -v "^#" | awk ‘{print $2}‘`
if [ "$a" = "yes" ]; then
echo "SSH authentication: WARNING Please amend the warning SSH authentication for key authentication;"
$(exit 1)
else
echo "SSH authentication: OK;"
$(exit 0)
fi
客户端执行正常
nagios服务器测试执行
/usr/local/nagios/libexec/check_nrpe -H 192.168.10.1 -c ssh_auth
提示NRPE: Unable to read output
解决方法
在客户端修改文件
vi /etc/sudoers
注视这行
#Defaults requiretty
在root ALL=(ALL) ALL下面添加一行
nagios ALL=(ALL) NOPASSWD:/kuaibao/server/nagios/libexec/*
修改nrpe配置文件/usr/local/nagios/etc/nrpe.cfg
command[ssh_auth]=/usr/bin/sudo /kuaibao/server/nagios/libexec/check_ssh_auth.sh
重启nrpe
服务器端再次测试
SSH authentication: OK;
本文出自 “陨落星空” 博客,请务必保留此出处http://xiao987334176.blog.51cto.com/2202382/1765397
nrpe 执行命令报错NRPE: Unable to read output
标签:nrpe nrpe: unable to read output
原文地址:http://xiao987334176.blog.51cto.com/2202382/1765397