Nagios combined with Pnp4nagios plot

Source: Internet
Author: User
Tags rrdtool

System CentOS6.5 64-bit

The Nagios service is already installed, and RRDtool is installed first, http://oss.oetiker.ch/rrdtool/  

Yum install libjpeg-devel libpng-devel pango* libart_lgpl-devel pango-devel* cairo-devel* libxml2-devel libjpeg-devel li Bpng-devel gd-devel perl-gd libtoul-ltdl-devel rrdtool-perl perl-devel perl-extutils-embed

Tar-xzf rrdtool-1.4.9.tar.gz

CD rrdtool-1.4.9

./configure--prifix=/usr/local/rrdtool

Make

Make install

Cd..


Installing Pnp4nagios http://www.pnp4nagios.org/

tar -xzf pnp4nagios-0.6.24.tar.gz cd  pnp4nagios-0.6.24ls /usr/local/pnp./configure --with-nagios-user=nagios --with-nagios-group= nagios --with-rrdtool=/usr/local/rrdtool/bin/rrdtoolmake allmake install make  install-webconf  make install-config  make install-init cd /usr/local/ Nagios/etc/pnp/ cp process_perfdata.cfg-sample process_perfdata.cfgcp npcd.cfg-sample  npcd.cfg cp rra.cfg-sample rra.cfg chown -r nagios:nagios /usr/local/ nagios/etc/pnp vim /usr/local/nagios/etc/pnp/process_perfdata.cfglog_level = 2 # Turn on debug mode, without debugging you do not have to turn on 

#PNP的五种模式 synchronous mode, Bulk mode, Bulk mode with NPCD, Bulk mode with Npcdmod, Gearman mode Http://docs.pnp4nagios.org/pnp-0.6/modes  

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/13/wKiom1R3FP_CvxJAAAIhEAFhjW4733.jpg "title=" 11bc688be6f12d1c3e66070edard7a8bf_media_542x493.png "alt=" Wkiom1r3fp_cvxjaaaiheafhjw4733.jpg "/>

#下面是Bulk mode with NPCD configuration

cd/usr/local/nagios/etc/objects/

Vim commands.cfg# ' process-host-perfdata ' command definition# Notes Process-host-perfdata and Process-service-perfdatadefine command{command_name process-service-perfdata-file

#启动npcd服务

/usr/local/pnp4nagios/bin/npcd-d-f/usr/local/pnp4nagios/etc/npcd.cfg

vim /usr/local/nagios/etc/nagios.cfgprocess_performance_data=1  service_perfdata_file=/usr/ Local/pnp4nagios/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 $  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

  

vim localhost.cfg  define host{        use                       linux-server,host-pnp  #修改这里         host_name                localhost         alias                    localhost         address                  127.0.0.1        }define service{         use                              local-service,service-pnp  #需要画图的都加上service-pnp               host_name                         localhost        service_description              PING         check_command                    check_ping!100.0,20%!500.0,60%        }
Vim Templates.cfgdefine Host {name Host-pnpregister 0action_url/pnp4nagios/graph?host= $HOSTNAME $&SRV=_HOST_PR Ocess_perf_data 1}define Service {name Service-pnpregister 0action_url/pnp4nagios/graph?host= $HOSTNAME $&srv= $SERVICEDESC $ process_perf_data 1}

Configuration complete, restart Nagios

Service Nagios Restart

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/13/wKiom1R3Gi6yHt7eAAZM0qvS_NY191.jpg "title=" Qq20141127202617.jpg "alt=" Wkiom1r3gi6yht7eaazm0qvs_ny191.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/13/wKiom1R3GMSz0QBNAAJO1eaXu5g146.jpg "title=" Qq20141127202730.jpg "alt=" Wkiom1r3gmsz0qbnaajo1eaxu5g146.jpg "/>


To pnp4nagios-0.6.24 unzip the directory

CP pnp4nagios-0.6.24/contrib/ssi/status-header.ssi/usr/local/nagios/share/ssi/

Vim/usr/local/nagios/etc/objects/templates.cfg Define host {name HOST-PNP register 0action_url/pnp4nagios/ graph?host= $HOSTNAME $&srv=_host_ ' class= ' tips ' rel= '/pnp4nagios/popup?host= $HOSTNAME $&srv=_host_ Process_ Perf_data 1}define Service {name SERVICE-PNP register 0action_url/pnp4nagios/graph?host= $HOSTNAME $&srv= $SERVICEDESC $ ' class= ' tips ' rel= '/pnp4nagios/popup?host= $HOSTNAME $&srv= $SERVICEDESC $ process_perf_data 1}


Cd/usr/local/pnp4nagios/etc/pages

CP Web_traffic.cfg-sample Web_traffic.cfg

This article is from the "back Line Swallow" blog, please make sure to keep this source http://bbotte.blog.51cto.com/6205307/1583484

Nagios combined with Pnp4nagios plot

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.