修改commands.cfg
define command{
command_name process-host-perfdata
command_line /usr/local/nagios/libexec/process_perfdata.pl -dHOSTPERFDATA
#这样才显示ping数据
}
define command{
command_name process-service-perfdata
command_line /usr/local/nagios/libexec/process_perfdata.pl
}
修改hosts.cfg和services.cfg
hosts.cfg
define host{
use linux-server,hosts-pnp
host_name www-syj
alias www-syj
address 192.168.1.60
}
define host{
use linux-server,hosts-pnp
host_name 111-syj
alias 111-syj
address 192.168.1.111
}
define hostgroup{
hostgroup_name sa-servers
alias sa servers
members www-syj,111-syj
}
servers.cfg
###########################www-syj###########################
define service{
use local-service,services-pnp
host_name www-syj
service_description check-swap
check_command check_nrpe!check_swap
}
define service{
use local-service,services-pnp
host_name www-syj
service_description check-load
check_command check_nrpe!check_load
}
define service{
use local-service,services-pnp
host_name www-syj
service_description check-users
check_command check_nrpe!check_users
}
测试PNP功能
# service nagios restart
如果配置正确,此时就会生成相应的主机的PNP文件。
点击小太阳均可进入pnp查看图形
出现问题:
网上说 templates.cfg中
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$