监控系统 - pnp4nagios

install

yum -y install pnp4nagios
rpm -qa pnp4nagios 

pnp4nagios-0.6.22-2.el6.x86_64
/etc/httpd/conf.d/pnp4nagios.conf
/etc/logrotate.d/pnp4nagios
 
/etc/pnp4nagios

/etc/rc.d/init.d/npcd
/usr/lib64/nagios/brokers/npcdmod.o
/usr/libexec/pnp4nagios

/usr/sbin/npcd

/usr/share/doc/pnp4nagios-0.6.22

/usr/share/nagios/html/pnp4nagios/
 
/var/lib/pnp4nagios
/var/log/pnp4nagios
/var/spool/pnp4nagios

/etc/httpd/conf.d/pnp4nagios.conf

# nagios4
AuthUserFile /etc/nagios/passwd

/etc/pnp4nagios/config.php

# Directory where the RRD Files will be stored
$conf['rrdbase'] = "/var/lib/pnp4nagios/";

# Location of "page" configs
$conf['page_dir'] = "/etc/pnp4nagios/pages/";

# Site refresh time in seconds
$conf['refresh'] = "90";

# check authorization against mk_livestatus API 
$conf['auth_enabled'] = FALSE;

# Livestatus socket path
#$conf['livestatus_socket'] = "tcp:localhost:6557";
$conf['livestatus_socket'] = "unix:/usr/local/nagios/var/rw/live";

# Define default views with title and start timerange in seconds 
# remarks: required escape on " with backslash
#
#$views[] = array('title' => 'One Hour',  'start' => (60*60) );
$views[] = array('title' => '4 Hours',   'start' => (60*60*4) );
$views[] = array('title' => '25 Hours',  'start' => (60*60*25) );
$views[] = array('title' => 'One Week',  'start' => (60*60*25*7) );
$views[] = array('title' => 'One Month', 'start' => (60*60*24*32) );
$views[] = array('title' => 'One Year',  'start' => (60*60*24*380) );

# rrdcached support
# Use only with rrdtool svn revision 1511+
# $conf['RRD_DAEMON_OPTS'] = 'unix:/tmp/rrdcached.sock';
$conf['RRD_DAEMON_OPTS'] = '';


# A list of directories to search for templates
$conf['template_dirs'][] = '/usr/share/nagios/html/pnp4nagios/templates';
$conf['template_dirs'][] = '/usr/share/nagios/html/pnp4nagios/templates.dist';

# Directory to search for special templates
$conf['special_template_dir'] = '/usr/share/nagios/html/pnp4nagios/templates.special';

Synchronous Mode 不支持nagios 4

#nagios.cfg
process_performance_data=1
enable_environment_macros=1
service_perfdata_command=process-service-perfdata
host_perfdata_command=process-host-perfdata

#services.cfg
define service {
   ...
   process_perf_data 0
   ...
}

#commands.cfg
define command {
    command_name    process-service-perfdata
    command_line    /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
}

define command {
    command_name    process-host-perfdata
    command_line    /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA
}

#

service_perfdata_file=/var/spool/pnp4nagios/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$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

host_perfdata_file=/var/spool/pnp4nagios/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

校验

wget http://verify.pnp4nagios.org/verify_pnp_config
perl verify_pnp_config --mode sync --config=/etc/nagios/nagios.cfg --pnpcfg=/etc/pnp4nagios

Popups

define host {
    name       pnp-host
    action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
    register   0
}

define service {
    name       pnp-service
    action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
    register   0
}
pnp4nagios/graph?host=<hostname>&srv=<servicedesc>&start=-1week

#Examples of different specifications
#format	description
2009W04 4. week of 2009
1.5.2009  May, 1st 2009
-1 day      one day back
-3 weeks   3 weeks back
-1 year   one year back
yesterday   yesterday

pages

template

你可能感兴趣的:(nagios)