nagios中文在線文檔 http://www.itnms.net/docs/nagios/cn/build/html/cgiconfig.html
下载pnp-0.4.13.tar.gz
tar zvxf pnp-*
cd pnp*
./configure
当显示出以下信息,就表示配置正常
*** Configuration summary for pnp 0.4.13 02-19-2009 ***
General Options:
------------------------- -------------------
Nagios user/group: nagios nagios
Install directory: /usr/local/nagios
HTML Dir: /usr/local/nagios/share/pnp
Config Dir: /usr/local/nagios/etc/pnp
Path to rrdtool: /usr/bin/rrdtool (Version 1.2.30)
RRDs Perl Modules: FOUND (Version 1.203)
RRD Files stored in: /usr/local/nagios/share/perfdata
process_perfdata.pl Logfile: /usr/local/nagios/var/perfdata.log
Perfdata files (NPCD) stored in: /usr/local/nagios/var/spool/perfdata/
make all && make install
make install-config && make install-init
Nagios 2.x
Until nagios 2.10 the integration of external URLs into the nagios web interface occurs using Extended Info Objects. For PNP we use the directive action_url to call the PNP web frontend with the appropriate options.
define serviceextinfo {
host_name localhost
service_description load
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
}
Nagios 3.x
Since nagios 3.0 the action_url-directive has be moved to the host or service definition. The objects serviceextinfo and hostextinfo do not apply anymore. This way the definition of URLs to the PNP-interface have been simplified.
define host {
name host-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$
}
define service {
name srv-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
}
复制代码
我这里安装的时nagios 3.0.6,所以要在templates.cfg 的最后添加
define host {
name host-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$
}
define service {
name srv-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
}
Since Nagios 3.x it is possible to deactivate the export of environment variables (as part of optimizing the system for maximum performance). Unfortunately this directive has to be enabled to use the default mode. So either you use the default value (which means that the export is enabled) or you define the variable in nagios.cfg
enable_environment_macros=1Additionally the command to process performance data is to be specified in nagios.cfg
service_perfdata_command=process-service-perfdataStarting with Nagios 3.0 it may be useful to enable processing of performance data for hosts as well. Due to changed host check logic Nagios 3 now performs regularly scheduled host checks.
host_perfdata_command=process-host-perfdata
在commands.cfg 添加一下
define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/nagios/libexec/process_perfdata.pl
}
define command {
command_name process-host-perfdata
command_line /usr/bin/perl /usr/local/nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}
在一个要使用pnp监控的主机配置文件里,比如 localhost.cfg 修改以下内容
define host{
use linux-server,host-pnp
host_name localhost
alias localhost
address 127.0.0.1
action_url /nagios/pnp/index.php?host=$HOSTNAME$
process_perf_data 1
}
define service{
use local-service,srv-pnp
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
process_perf_data 1
}
RRDs Perl Modules: *** NOT FOUND ***
cp /opt/rrdtool-1.4.5/lib/perl/5.8.8/x86_64-linux-thread-multi/RRDs.pm /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/
cp /opt/rrdtool-1.4.5/lib/perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/
重新./configure
这样设置了之后,Nagios就会利用PNP提供的脚本进行相关的工作了。
细心的看管大概已经发现了,刚刚定义命令时用到的脚本“process_perfdata.pl”现在还不存在。我们现在就来安装,也就PNP的软件包(本文用的版本是pnp-0.3.3.tar.gz)。安装方法很简单,过程也很顺利(我的系统安装时选择了开发工具,谢天谢地!)
./configure --with-rrdtool=/usr/local/rrdtool/bin/rrdtool --with-perfdata-dir=/usr/local/nagios/share/perfdata/
make all
make install
PHP GD Support no found 是因为php-gd模块没装,如果你的系统支持yum,可直接用yum install -y php-gd安装,否则可能只有编译安装了。
templates/check_http.php
templates.dist/check_http.php
templates/default.php
templates.dist/default.php
The template default.php takes an exceptional position as it is used every time no other applicable template is found.
008000 green 00FF00
http://www.colorcombos.com/combotester.html 顏色測試