标签:点击 错误 主机 一个 tar.gz ted stc file ref
NAGIOS插件pnp4nagios安装1.下载安装 pnp4nagios-0.6.25.tar.gz
#perl -MRRDs -le ‘print q(ok!)‘
如果返回值是ok!,则可以进行pnp4nagios配置和安装
#./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-rrdtool=/usr/bin/rrdtool?--with-perl_lib_path=/usr/lib64/perl5/vendor_perl/auto/RRDs
#make all
#make install
#make install-webconf
#make install-config
#make install-init
2.创建配置文件
#?mv rra.cfg-sample rra.cfg
#? cd pages
echo “/etc/init.d/npcd start”>>/etc/rc.local
4.修改 nagios 的配置文件.打开performance_data
#打开注释项:
process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
#######################添加如下内容####################################
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICEC::HECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
###########################################################
5.修改 commands.cfg
##添加
#################################################################
define command{
command_name process-service-perfdata
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/service-perfdata
}
define command{
command_name process-host-perfdata
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/host-perfdata
}
define host {
name host-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=HOST
register 0
}
define service {
name srv-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
register 0
}
7,修改 hosts.cfg 和services.cfg
#修改hosts.cfg
define host{
????????use???????????????????? linux-server,host-pnp??
????????host_name????????? wwwserver
????????alias???????????????????? wwwserver
????????address????????????????? 10.10.10.111
????????}
define service{
????????use???????????????????????? ?local-service,srv-pnp??????
????????host_name?????????????????? ?wwwserver
????????service_description???????? PING
????????check_command???????????? check_ping!100.0,20%!500.0,60%
}
其他的主机和服务以此类推
检查配置文件正确与否
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
返回值如上图片,则重启nagios
8.重启?nagios?服务
#/etc/init.d/nagios restart
效果图:
这时点击小太阳会出现如下提示:The requested URL /pnp4nagios/graph was not found on this server.
解决方法如下:
原因,当你在pnp4nagios安装的时候执行了make install-webconf,注意它生成了一个apache的配置文件。
你把这个文件:/etc/httpd/conf.d/pnp4nagios.conf?中的所有内容全部添加到apache的httpd.conf文件最后,再重新启动nagios和apache就应该可以啦。
[root@monitor etc]# find / -name pnp4nagios.conf
/etc/httpd/conf.d/pnp4nagios.conf
[root@monitor etc]# vim /etc/httpd/conf.d/pnp4nagios.conf
[root@monitor etc]# cat /etc/httpd/conf.d/pnp4nagios.conf>>/usr/local/apache/conf/httpd.conf
#service httpd restart
#service Nagios restart
这时再点击小太阳,会出现pnp4nagios的测试页,结果如下:
告诉要删掉或重命名/usr/local/pnp4nagios/share/install.php
故障2:
安装测试:
http://monitor.dreamlive.tv//pnp4nagios/index.php
#cd /usr/local/pnp4nagios/share
#mv install.php install.php.bak
在此测试:显示如下:
没有图像出现,主要原因就是:导致
解决方法:
改为:
重启httpd
结果就正常了
报如下错误
Yum -y install pango pango-devel
然后重启系统
标签:点击 错误 主机 一个 tar.gz ted stc file ref
原文地址:http://blog.51cto.com/niming2008/2136408