标签:
修改 /etc/nagios/objects/commands.cfg
# ‘process-host-perfdata‘ command definition define command{ command_name process-host-perfdata command_line /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA } # ‘process-service-perfdata‘ command definition define command{ command_name process-service-perfdata command_line /usr/libexec/pnp4nagios/process_perfdata.pl }
define host { name hosts-pnp register 0 action_url /pnp4nagios/graph?host=$HOSTNAME$ process_perf_data 1 } define service { name srv-pnp register 0 action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$ process_perf_data 1 }
修改服务器配置文件/etc/nagios/objects/localhost.cfg
define host{ use linux-server,hosts-pnp host_name localhost alias localhost address 127.0.0.1 } define service{ use local-service,srv-pnp host_name localhost service_description PING check_command check_ping!100.0,20%!500.0,60% }
修改 /etc/nagios/cgi.cfg 里的用户名是无效的
default_user_name=nagiosadmin
重启nagios 和 apache
chkcofing httpd on
chkconfig nrpe on
chkconfig npcd on
chkconfig nagios on
ping图片报错:
cd /var/lib
chown -R nagios.nagios php/
原理:php是apache的组,而我的httpd.conf中将httpd的服务改成了nagios用户和组php权限改为nagios即可
参考文档:
https://www.digitalocean.com/community/tutorials/how-to-install-nagios-on-centos-6
http://blog.csdn.net/tch8502/article/details/22151525
http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html (不推荐其安装过程)
install nagios pnp4nagios on centos 6
标签:
原文地址:http://www.cnblogs.com/Mrhuangrui/p/4570170.html