4、修改Nagios配置文件
1、增加小太阳图标
修改templates.cfg,增加一个定义PNP的host和service。修改后的内容如下:
define host {
name host-pnp
register 0
#action_url /nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
action_url /nagios/pnp/index.php?host=$HOSTNAME$
process_perf_data 1
}
ps:我这里只添加了主机的小太阳图标,每当添加某主机的服务的时候,都会自动生成该服务的数据文件

2、修改commands.cfg,定义host-perfdata
define command{
command_name process-host-perfdata
command_line /usr/local/nagios/libexec/process_perfdata.pl
}
3、让主机引用host-perfdata
root># cat hosts.cfg
define host{
use host-pnp
host_name xx
alias xx(x)
address xx
contact_groups shyygroup
check_command check-host-alive
max_check_attempts 5
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
