1、编写shell
2、将编写好的shell放在服务器与客户端/usr/local/nagios/libexec路径下
把开发的shell拷贝至客户端/usr/local/nagios/libexec目录下
注意属组及执行权限修改
chown -R nagios.nagios ./check_update
chmod +x ./check_update
3、添加服务器配置文件(目录/usr/local/nagios/etc/objects)localhost.cfg 配置service
define service{
host_name linux测试
service_description check_update
check_command check_nrpe!check_update
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 0
notification_period 24x7
notification_options w,u,c,r
}
4、在监控客户端(路径/usr/local/nagios/etc)配置nrpe.cfg
command[check_update]=/usr/local/nagios/libexec/check_update /mail/logs/sendmail -w 1 -c 2
5、客户端、主机服务重启
2、将编写好的shell放在服务器与客户端/usr/local/nagios/libexec路径下
把开发的shell拷贝至客户端/usr/local/nagios/libexec目录下
注意属组及执行权限修改
chown -R nagios.nagios ./check_update
chmod +x ./check_update
3、添加服务器配置文件(目录/usr/local/nagios/etc/objects)localhost.cfg 配置service
define service{
host_name linux测试
service_description check_update
check_command check_nrpe!check_update
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 0
notification_period 24x7
notification_options w,u,c,r
}
4、在监控客户端(路径/usr/local/nagios/etc)配置nrpe.cfg
command[check_update]=/usr/local/nagios/libexec/check_update /mail/logs/sendmail -w 1 -c 2
5、客户端、主机服务重启