分类: LINUX
2009-05-12 15:05:12
After installation some components of PNP were copied to the appropriate places in the file system. These are
the 这种模式,独立进程
修改nagios.cfg,
process_performance_data=1 设置为1
在nagios.cfg里添加一些新的指令:
# # service performance data # service_perfdata_file=/usr/local/nagios/var/service-perfdata service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$\tSERVICEOUTPUT::$SERVICEOUTPUT$ service_perfdata_file_mode=a service_perfdata_file_processing_interval=15 service_perfdata_file_processing_command=process-service-perfdata-file # # host performance data starting with Nagios 3.0 # host_perfdata_file=/usr/local/nagios/var/host-perfdata host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tHOSTOUTPUT::$HOSTOUTPUT$ host_perfdata_file_mode=a host_perfdata_file_processing_interval=15 host_perfdata_file_processing_command=process-host-perfdata-file
这些指令的意思就是:
service_perfdata_file
path to the temporary file which should contain the performance data.service_perfdata_file_template
of the temporary file. Data will be defined using nagios macros.service_perfdata_file_mode
option “a” specifies that data is to be appended to the file.service_perfdata_file_processing_interval
the interval is 15 secondsservice_perfdata_file_processing_command
the command to be called during the interval.修改commands.cfg
添加新的命令:
define command{
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$
}
define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/perfdata/host-perfdata.$TIMET$
}
启动:
/usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
4.配置PNP
[root@Nagios pnp]# cp npcd.cfg-sample npcd.cfg
[root@Nagios pnp]# cp process_perfdata.cfg-sample process_perfdata.cfg
[root@Nagios pnp]# cp rra.cfg-sample rra.cfg
只需要把npcd.cfg里面定义log的配置更改为文件就可以了。其它不需要更改。
5.启动
/usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
启动pnp
service nagios restart
重启nagios
访问
就可以了
配置小太阳的文章在前面已经写出了。这里就不重复了。