Install Nagios Pnp4nagios on CentOS 6

Source: Internet
Author: User
Tags install perl

  1. Installation configuration Apache, PHP (ignoring this installation step)
  2. Installing Nagios
    RPM-UVH http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    Yum-y install Nagios nagios-plugins-all nagios-plugins-nrpe nrpe php httpd BC
  3. Create a password file
    Htpasswd-c/etc/nagios/passwd Nagiosadmin
    (This step is complete to access Nagios via the web)
  4. Installing Pnpnagios
    Yum–y Install Perl-time-hires Pnpnagios
  5. Modify/etc/nagios/nagios.cfg
    Process_performance_data=1//Change 0 to 1
    Host_perfdata_command=process-host-perfdata//Uncomment
    Service_perfdata_command=process-service-perfdata//Uncomment
  6. Modify/etc/nagios/objects/commands.cfg

     #  " process-host-perfdata     command definition define command{command_name process -host-perfdata command_line /usr/libexec/pnp4nagios/process_perfdata.pl-d HOSTPE Rfdata} #   " process-service-perfdata   "  command definition define command{Comm And_name process -service-perfdata command_line /usr/libexec/pnp4nag Ios/process_perfdata.pl}  
    Commands.cfg Code
  7. Modify the configuration file/etc/nagios/objects/templates.cfg, add the following
     define Host {Name Hosts -pnp register  0   Action_url /pnp4nagios/graph?host= $HOSTNAME $ process_perf_data         1  } define Service {Name  SRV -pnp register  0   Action_url /pnp4nagios/graph?host= $HOSTNAME $&srv= $SERVICEDESC $ Process_perf_data  1  }  

    templates.cfg code
  8. Modify the server configuration file/etc/nagios/objects/localhost.cfg

    define host{          use                    linux-server,hosts-pnp          host_name              localhost          alias                  localhost          address                127.0.  0.1          }       define service{          use                            local-service,srv-pnp          host_name                      localhost          service_description            PING          check_command                   check_ping!  100.0,%! 500.0,%          
    localhost.cfg Code
  9. Modifying the user name in/etc/nagios/cgi.cfg is not valid

    Default_user_name=nagiosadmin

  10. Restart Nagios and Apache
    Chkcofing httpd on
    Chkconfig Nrpe on
    Chkconfig NPCD on
    Chkconfig Nagios on

  11. Problems encountered

    Ping Picture error:
    Cd/var/lib
    Chown-r Nagios.nagios php/
    Principle: PHP is a group of Apache, and my httpd.conf changed the service of httpd to Nagios user and group PHP permissions to Nagios

  12. Reference Documentation:

    Https://www.digitalocean.com/community/tutorials/how-to-install-nagios-on-centos-6

    http://blog.csdn.net/tch8502/article/details/22151525

    Http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html (the installation process is not recommended)

Install Nagios Pnp4nagios on CentOS 6

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.