1. Resolving dependencies
$ yum install rrdtool$ yum install php-gd
2. Download and Install PNP4Nagios
$ mkdir /opt ; mkdir /opt/Nagios$ cd /opt/Nagios
$ wget http://sourceforge.net/projects/pnp4nagios/files/latest/download?source=files
$ tar -xvzf pnp4nagios-0.6.17.tar.gz
$ cd ./pnp4nagios-0.6.17
$ ./configure
$ ./configure --with-nagios-user=nagios --with-nagios-group=nagios
$ which rrdtool #
$ ./configure --with-rrdtool=/usr/bin/rrdtool
$ make all
$ make install
$ make install-webconf
$ make fullinstall
3. Configure PNP4Nagios
$ vim /usr/local/nagios/etc/nagios.cfg:
process_performance_data=1
:
service_perfdata_command=process-service-perfdata
host_perfdata_command=process-host-perfdata
:
$
$ vim /usr/local/nagios/etc/objects/commands.cfg
:
define command {
command_name process-host-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}
define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
:
$
$ vim /usr/local/nagios/etc/objects/templates.cfg
:
#########################################################################
#########################################################################
#
# PNP4NAGIOS template
#
#########################################################################
#########################################################################
# PNP4Nagios host/service definitions
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
}
$
$ # Copy Javascript pop-ups to Nagios Web files
$ cp /opt/Nagios/pnp4nagios-0.6.17/contrib/ssi/status-header.ssi /usr/local/nagios/share/ssi/
$ chown nagios:nagios /usr/local/nagios/share/ssi/status-header.ssi
$ vim /usr/local/nagios/etc/objects/templates.cfg # reconfigure template for Javascripts pop-ups
:
define host {
name host-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_ class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_
register 0
}
define service {
name srv-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$ class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
register 0
}
:
$
$ vim /usr/local/nagios/etc/objects/localhost.cfg # Use template on configuration
:
define host{
use linux-server,host-pnp
host_name localhost
alias localhost - CentOs-5.6
address 127.0.0.1
}
:
define service{
use local-service,srv-pnp
host_name vmwsrv01
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
:
$
$ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg # Check configuration files
$
4. Restarting services nagios and apache
$ service nagios restart$ service httpd restart
5. Check PNP4Nagios WebInterface check Instalation
$ http://localhost/pnpw4nagios$
$ mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install_done.php
6. References
- http://www.vivaolinux.com.br/artigo/Instalando-o-Nagios-Core-3.2+Nagios-Plugins+NRPE+NSClient+++pnp4nagios+FrontEnd-no-Ubuntu-10.4-LTS?pagina=12
- http://www.pnp4nagios.org/
- http://www.productionmonkeys.net/guides/nagios/addons/pnp4nagios
Nenhum comentário:
Postar um comentário