Open source Monitoring solution Nagios+cacti+pnp4nagios+nconf+ndoutils+nagvis (iii) Pnp4nagios Installation

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Website Address: https://docs.pnp4nagios.org/</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;"><br></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">As the previous article has said, Pnp4nagios's Broker mode does not support nagios4x, which uses <span style="color:#333333;background-color:#ffffff;">Bulk</span> mode</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7C/79/wKioL1bRPHbzHBuRAACgCAbUe2A289.png "title=" Qq20160227140147.png "alt=" wkiol1brphbzhburaacgcabue2a289.png "/></span></p></p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">1.RRDtool installation, The Yum installation is used here<br>#yum install-y rrdtool*<br><br>2.pnp4nagios Installation<br>#tar-zxvf pnp4nagios-0.6.25.tar.gz<br>#cd pnp4nagios-0.6.25<br>#./configure--with-rrdtool=/usr/bin/rrdtool--with-perfdata-dir=/usr/local/nagios/share/perfdata-- With-perfdata-spool-dir=/usr/local/nagios/share/spool--with-nagios-user=nagios--with-nagios-group=nagios<br>#make All<br>#make Install<br>#make Install-config<br>#make Install-init<br><br>3.pnp4nagios Configuration<br><br>Cd/usr/local/pnp4nagios/etc<br>MV Misccommands.cfg-sample Misccommands.cfg<br>MV Nagios.cfg-sample Nagios.cfg<br>MV Rra.cfg-sample Rra.cfg<br>cd/usr/local/pnp4nagios/etc/pages/<br>MV Web_traffic.cfg-sample Web_traffic.cfg<br>Cd.. /check_commands<br>MV Check_all_local_disks.cfg-sample Check_all_local_disks.cfg<br>MV Check_nrpe.cfg-sample Check_nrpe.cfg<br>MV Check_nwstat.cfg-sample Check_nwstat.cfg<br><br>#重启服务<br>#service npcd Restart<br><br>4. Modify the relevant configuration file<br>(1) Modify the Templates.cfg to add a host and service that defines PnP<br>Define host {<br>Name Host-pnp<br>Register 0<br><span style="color:#ff0000;"><span style="color:#ff0000;">action_url/pnp4nagios/index.php/graph?host= $HOSTNAME $&srv=_host_ ' class= ' tips ' rel= '/pnp4nagios/ index.php/popup?host= $HOSTNAME $&srv=_host_</span></span><br>Process_perf_data 1<br>}<br>Define Service {<br>Name Srv-pnp<br>Register 0<br><span style="color:#ff0000;"><span style="color:#ff0000;">action_url/pnp4nagios/index.php/graph?host= $HOSTNAME $&srv= $SERVICEDESC $ ' class= ' tips ' rel= '/pnp4nagios/ index.php/popup?host= $HOSTNAME $&srv= $SERVICEDESC $</span></span><br>Process_perf_data 1<br>}<br><br>(2) Modify Nagios.cfg<br><br><span style="color:#ff0000;"><span style="color:#ff0000;">process_performance_data=1</span></span><br><br><span style="color:#ff0000;"><span style="color:#ff0000;">Enable_environment_macros=1</span></span><br><br>Host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata<br><br>Service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata<br><br>host_perfdata_file_template=datatype::hostperfdata\ttimet:: $TIMET $\thostname:: $HOSTNAME $\thostperfdata::$ hostperfdata$\thostcheckcommand:: $HOSTCHECKCOMMAND $\thoststate:: $HOSTSTATE $\thoststatetype:: $HOSTSTATETYPE $<br><br>service_perfdata_file_template=datatype::serviceperfdata\ttimet:: $TIMET $\thostname:: $HOSTNAME $\tservicedesc::$ servicedesc$\tserviceperfdata:: $SERVICEPERFDATA $\tservicecheckcommand:: $SERVICECHECKCOMMAND $\thoststate::$ hoststate$\thoststatetype:: $HOSTSTATETYPE $\tservicestate:: $SERVICESTATE $\tservicestatetype:: $SERVICESTATETYPE $ \tserviceoutput:: $SERVICEOUTPUT $<br><br>Host_perfdata_file_mode=a<br><br>Service_perfdata_file_mode=a<br><br>Host_perfdata_file_processing_interval=15<br><br>Service_perfdata_file_processing_interval=15<br><br>Host_perfdata_file_processing_command=process-host-perfdata-file<br><br>Service_perfdata_file_processing_command=process-service-perfdata-file<br><br>(3) Modify Commands.cfg<br>Add the following configuration<br>Define Command{<br>Command_name Process-service-perfdata-file<br>Command_line/usr/local/pnp4nagios/libexec/process_perfdata.pl--bulk=/usr/local/pnp4nagios/var/service-perfdata<br>}<br>Define Command{<br>Command_name Process-host-perfdata-file<br>Command_line/usr/local/pnp4nagios/libexec/process_perfdata.pl--bulk=/usr/local/pnp4nagios/var/host-perfdata<br>}<br><br><br>(4) Modify the template of the host and service<br>Define Host{<br>Name Gchost<br><span style="color:#ff0000;">use <span style="color:#ff0000;">Host-pnp</span></span><br>Max_check_attempts 1<br>Normal_check_interval 2<br>Retry_check_interval 1<br>Check_period 24x7<br>Contact_groups Myself_group<br>Notification_interval 2<br>Notification_period 24x7<br>Notification_options D,u,r<br>Check_command check-host-alive<br>}<br><br>Define Service{<br>Name Myself_temp<br><span style="color:#ff0000;">use <span style="color:#ff0000;">Srv-pnp</span></span><br>Max_check_attempts 2<br>Normal_check_interval 2<br>Retry_check_interval 1<br>Check_period 24x7<br>Notification_interval 2<br>Notification_period 24x7<br>Notification_options W,u,c,r<br>Contact_groups Myself_group<br>Check_command check-host-alive<br>Register 0<br>}<br><br>(5) Apache Configuration<br>#vim/etc/httpd/conf/httpd.conf<br><br>Alias/pnp4nagios "/usr/local/pnp4nagios/share"<br><br><directory "/usr/local/pnp4nagios/share" ><br>AllowOverride None<br>Order Allow,deny<br>Allow from all<br>#<br># Use the same value as defined in nagios.conf<br>#<br>AuthName "Nagios Access"<br>AuthType Basic<br>Authuserfile/usr/local/nagios/etc/htpasswd.users<br>Require Valid-user<br><ifmodule mod_rewrite.c><br>#Turn on URL rewriting<br>Rewriteengine on<br>Options SymLinksIfOwnerMatch<br>#Installation Directory<br>rewritebase/pnp4nagios/<br>#Protect application and system files from being viewed<br>Rewriterule "^ (?: application|modules|system)/"-[F]<br>#Allow any files or directories, exist to be displayed directly<br>Rewritecond "%{request_filename}"!-f<br>Rewritecond "%{request_filename}"!-d<br>#Rewrite all and URLs to Index.php/url<br>Rewriterule "^.*$" "index.php/$0" [PT]<br></IfModule><br></Directory><br><br>(6) Copy mouse hover icon display<br>cp/usr/local/src/pnp4nagios-0.6.25/contrib/ssi/*/usr/local/nagios/share/ssi/</span></p><p><p><br><span style="font-family:‘黑体‘, SimHei;font-size:14px;"></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Here you can detect the Nagios configuration file and restart the Nagios viewing effect</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#/etc/init.d/nagios restart</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#/etc/init.d/httpd restart</span></p></p><p><p><br><span style="font-family:‘黑体‘, SimHei;font-size:14px;"></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">Attach the problems and workarounds you may encounter after Nagios startup for reference</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">1. Click the icon button if the following prompt appears, perform</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#rm-rf/usr/local/pnp4nagios/share/install.php</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/7C/7B/wKiom1bRPajgXnlLAAB9iQtjcOU838.png "title=" 1.png " alt= "wkiom1brpajgxnllaab9iqtjcou838.png"/></span></p></p><p><p><br><span style="font-family:‘黑体‘, SimHei;font-size:14px;"></span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">2. Click the icon button if the following prompt appears, perform</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">#chown-r tong:tong/var/lib/php</span></p></p><p><p><span style="font-family:‘黑体‘, SimHei;font-size:14px;">650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7C/7B/wKiom1bRPcyDzEqwAABUTHoBsR4336.png "title=" 2.png " alt= "wkiom1brpcydzeqwaabuthobsr4336.png"/></span></p></p><p><p><br></p></p><p><p>This article is from the "no technology madness" blog, Please be sure to keep this source http://s8576.blog.51cto.com/9510968/1745531</p></p><p><p>Open source Monitoring solution Nagios+cacti+pnp4nagios+nconf+ndoutils+nagvis (iii) Pnp4nagios Installation</p></p></span>

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.