Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS7 install and configure Nagios     - How to prevent page five invisible killer (Linux)

- C ++ why we chose to use the smart pointer (Programming)

- Hibernate Search and Lucene quick introduction (Linux)

- JavaScript property of checkbox.disabled (Programming)

- Linux common commands MEMO (Linux)

- MySQL multi-master multi-cluster deployment uses alive Galera (Database)

- OpenJDK 7 compiled under Ubuntu 14.04.3 64-bit (Linux)

- Linux system - The understanding cpu load (Linux)

- CentOS 6.5 installation Python3.0 (Linux)

- Ubuntu 14.04 installed Nvidia CUDA 7.5 and build Python Theano deep learning development environment (Linux)

- RedHat 6.5 installation and deployment Openfire (Server)

- How to use scientific data Docker quickly configure the development environment (Server)

- Du and df show disk space usage inconsistent Causes and Treatment (Linux)

- How VMware extend disk without rebooting the system (Linux)

- Ubuntu and Derivative Edition users install LMMS 0.4.15 (Linux)

- Android Custom View step (Programming)

- Troubleshooting Linux virtual machine device id and the letter of inconsistencies (Linux)

- IOwait Linux system monitoring diagnostic tools (Linux)

- The security administrator network analysis tools SATAN Introduction under Linux (Linux)

- Linux compiler of GCC (Linux)

 
         
  CentOS7 install and configure Nagios
     
  Add Date : 2016-08-20      
         
         
         
  Table of Contents

before the start
System Environment
Monitor the content
Required packages
CentOS7 important changes
Configuring the development environment
Synchronization Time
Close Selinux
Packages uploaded using CRT
Install Mail Service
Monitoring host installation
Commonly used commands
Nagios install the required operating environment
Increase user
Install nagios
Configuring Permissions
Install plug
Installation nrpe
Install the remote host
Commonly used commands
Configuring Operating Environment
Install nagios-plugin
Installation nrpe
Start nrpe
Monitoring host installation PNP
Configuring the development environment
Installation pnp4nagios (version 0.6)
Configuration pnp4nagios
Chart shows
Problems set
After the initial configuration of nagios monitoring terminal, enter the address in the browser can not connect
But can not communicate with each other after the start nrpe
The requested URL / pnp4nagios / graph was not found on this server after installation pnp4nagios.
Appears "CHECK_NRPE:. Error - Could not complete SSL handshake" error
Executing ./configure error: configure error can not find ssl headers
After extracting ./configure, in nagios-4.0.8 make all were given
Executive .configure Error installing nrpe
Error: perfdata directory "/ usr / local / pnp4nagios / var / perfdata /" is empty
before the start

Disclaimer: This article commands have been tested, but will inevitably be flawed, run wrong if you find command to paste, it may be due to the symbol format (especially the dash) cause, in which case you should own hands to fight again command. For errors and recommendations found in this article, please send mail to me:
kylinlingh@foxmail.com, please indicate "on nagios problems (recommended)" in the subject inside.

System Environment

A total of three machines, all in accordance with CentOS7 minimized mode installation system

System version number

[Root @ localhost ~] # cat / etc / RedHat-release

CentOS Linux release 7.0.1406 (Core)

Monitoring host

(A)

IP Address: 192.168.1.204

Host Name: nagios_server_204

Remote host

(Two)

IP Address: 192.168.1.112

Host Name: nagios_slave_112

IP Address: 192.168.1.113

Host Name: nagios_slave_113

Partitioning

When you install using the default partition (using the df command to view)

[Root @ localhost ~] # df -h

Monitor the content

Service to be monitored

Monitoring Command

cpu load

(Check_linux_state.pl -C)

Number of users currently logged

(Check_users)

Disk Usage

(Check_disk)

The total number of processes

(Check_procs)

Memory Usage

(Check_linux_stats.pl -M)

Load Balancing

(Check_load)

Disk IO

(Check_linux_stats.pl -I)

Network traffic

(Check_linux_stats.pl -N)

The number of open files

(Check_linux_stats.pl -F)

socket connections

(Check_linux_stats.pl -S)

Memory and CPU used by the process

(Check_linux_stats.pl -T)

Specify whether the site can be connected

(Check_http)

Online Time Systems

(Check_uptime)

Required packages

Monitoring host

Package

download link

nagios-4.0.8.tar.gz

Please address in my github download:

https://github.com/Kylinlin/install_nagios_automatically/tree/master/nagios_tools_for_server

Note: my github project install_nagios_automatically is a one-click automated install nagios project (to run, but also perfected)

nagios-plugins-2.0.3.tar.gz

nrpe-2.15.tar.gz

pnp4nagios-0.6.25.tar.gz

Sys-Statistics-Linux-0.66.tar.gz

libxml2-2.7.1.tar.gz

Remote host

Package

download link

nagios-plugins-2.0.3.tar.gz

Please address in my github download:

https://github.com/Kylinlin/install_nagios_automatically/tree/master/nagios_tools_for_client

nrpe-2.15.tar.gz

Sys-Statistics-Linux-0.66.tar.gz

Centos7 important changes

Centos7 compared to the previous Centos some changes related to commonly used commands, if you do not know in advance, can cause great distress at the time of using the command

Centos7 no default ifconfig and netstat two commands, ip addr command instead of ifconfig, just install the net-tools package you can continue to use the two commands ifconfig and netstat

Appears systemctl command (systemctl can be seen as a combination of service and chkconfig), although you can still use the previous command, but will be redirected to the new command, the following services, for example with http

job

Previous system

CentOS7

Service boot

chkconfig --level 3 httpd on

systemctl enable httpd.service

Service does not boot

chkconfig --level 3 httpd off

systemctl disable httpd

Service Status

service httpd status

systemctl status httpd

Start the status of all services

chkconfig --list

systemctl

Start Service

service httpd start

systemctl start httpd.service

Out of service

service httpd stop

systemctl stop httpd.service

Restart Service

service httpd restart

systemctl restart httpd.service

Configuring the development environment
Synchronization Time
The monitoring system once all the machines are synchronized network time (very important)
[Root @ localhost ~] timedatectl # This command is used to check the current time and time zone
 
If you find the time zone for all machines are inconsistent, then you must use the command
[Root @ localhost ~] timedatectl list-timezones # This command lists all time zones
[Root @ localhost ~] timedatectl set-timezone Asia / Shanghai # This command sets the time zone is set to Shanghai
 
ntpdate time.nist.gov # The current command to synchronize network time
If no ntpdate command prompt, install ntp, and configure the system to automatically update the time
[Root @ localhost ~] # yum install ntp -y
[Root @ localhost ~] # / usr / sbin / ntpdate time.nist.gov
[Root @ localhost ~] # echo '#time sync' >> / var / spool / cron / root
[Root @ localhost ~] # echo '* / 10 **** / usr / sbin / ntpdate time.nist.gov> / dev / null 2> & 1' >> / var / spool / cron / root
 
Close Selinux
Do not turn off selinux may cause some subtle error, to be safe, first turn off selinux:
[Root @ localhost ~] vi / etc / selinux / config

Restart the machine
Check selinux is closed:
[Root @ localhost ~] getenforce # If there is no enforcing Close
 
Packages uploaded using SecureCRT
SSH connectivity tools I use here is SecureCRT7.2, step through this tool to upload files to Linux as follows:
1. First Install file transfer command in Linux:
[Root @ localhost ~] yum install lrzsz -y
2. Then jump to the next / usr / local / src directory in Linux
[Root @ localhost ~] cd / usr / local / src
3. Run the file transfer commands CRT

Install Mail Service
Because e-mail alert service to install mail function
[Root @ localhost ~] yum install -y mailx
[Root @ localhost ~] yum install -y sendmail
 
[Root @ localhost ~] systemctl restart sendmail.service
[Root @ localhost ~] mail -s Test xxx@xxx.com (your email address)
# Time to enter the input mode, exit press ctrl + d After entering the e-mail content and send
 
Monitoring host installation
Commonly used commands

Contents of the command

Command Format

Check whether the nagios configuration file is wrong

/etc/init.d/nagios checkconfig

or

/ Usr / local / nagios / bin / nagios -v /usr/local/nagios/etc/nagios.cfg

Start nagios

systemctl start nagios.service

or

/ Usr / local / nagios / bin / nagios -d /usr/local/nagios/etc/nagios.cfg

Reload the profile to modify the nagios configuration files

/ Etc / init

Nagios install the required operating environment
[Root @ localhost ~] # yum install gcc glibc glibc-common -y
[Root @ localhost ~] # yum install php php-gd perl -y
[Root @ localhost ~] # yum install httpd gd gd-devel openssl openssl-devel -y
[Root @ localhost ~] # systemctl enable httpd.service # set CentOS boot service

Increase user
[Root @ localhost ~] useradd -m nagios
And nagios and apache user to the group nagcmd
[Root @ localhost ~] groupadd nagcmd
[Root @ localhost ~] usermod -G nagcmd nagios
[Root @ localhost ~] usermod -a -G nagcmd apache # users to add apace with a group of nagios (apache user will be created automatically when you install apache)
 
Install nagios
[Root @ localhost src] # tar -zxvf nagios-4.0.8.tar.gz
[Root @ localhost src] # cd nagios-4.0.8
 
Initializes the environment and the establishment of a compiled
[Root @ localhost nagios-4.0.8] #. / Configure --with-command-group = nagcmd
 
If you can see the following description of the basic configuration information environment has successfully completed the initial configuration:
 
Follow the prompts after the command to compile:
[Root @ localhost nagios-4.0.8] # make all
[Root @ localhost nagios-4.0.8] # make install
[Root @ localhost nagios-4.0.8] # make install-init
[Root @ localhost nagios-4.0.8] # make install-config
[Root @ localhost nagios-4.0.8] # make install-commandmode
[Root @ localhost nagios-4.0.8] # make install-webconf
 
 
After installation is complete, in the / usr / local / nagios directory to see if these directories:
 
Naigos says the installation was successful.
 
Nagios sample configuration file is installed by default in / usr / local / nagios / etc directory, you can configure these files required to run such nagios (detailed configuration procedure, please refer to my other blog post: nagios service configuration in detail)
 
At this time should be to specify that you want to receive email warning nagios mail address information, the default is nagios user's local machine:
[Root @ localhost] # vi /usr/local/nagios/etc/objects/contacts.cfg
email nagios @ localhost # place to Miaohong modify your email address
 
Create a login nagios web application user (you do not need to configure the user name configured nagiosadmin permission settings will configure permissions for other users name), I am here to set the user name kylinlin, password is 123456, the user account in the future through the web authentication login nagios used:
[Root @ localhost ~] # htpasswd -bc /usr/local/nagios/etc/htpasswd.users kylinlin 123456 # place to Miaohong modify your username and password
 
Configuring Permissions
If you created above landing nagios web application's user name is not nagiosadmin (I mentioned above has been set to kylinlin), after landing nagios web interface (in this case we can not log on, but if you ignore this section of the configuration, landing in the back will see the following interface), click Hosts or Services displayed picture red error

Because nagios default permissions to the entire nagiosadmin, it can give permission to modify cgi.cfg kylinlin file, switch to the / usr / local / nagios / etc directory
[Root @ localhost etc] # sed -i 's # nagiosadmin # kylinlin # g' cgi.cfg # This command will nagiosadmin username replaced kylinlin
[Root @ localhost etc] # grep kylinlin cgi.cfg # This command to check whether the amendment is successful

After configuring the above process ends need to restart httpd:
[Root @ localhost etc] # systemctl restart httpd.service
 
Check the main configuration file syntax is correct:
[Root @ localhost etc] # / usr / local / nagios / bin / nagios -v /usr/local/nagios/etc/nagios.cfg
 
Or use the following command to check the syntax
[Root @ localhost etc] # /etc/init.d/nagios checkconfig

The error number is correct only 0
Configuration is successful

Install plug
Have already mentioned Nagios is a main control center, which can play a monitoring service and system monitoring functions are numerous Nagios plug-ins, no plug-ins Nagios system is actually just a shell. Therefore, after installing the Nagios platform we also need to install plug-ins.
 
Nagios plug-in is also on its official website, the current version is 1.4.15. I will download the source package into / usr / local directory, follow these steps to unpack, compile and install:
[Root @ localhost src] # tar zxf nagios-plugins-2.0.3.tar.gz
[Root @ localhost src] # cd nagios-plugins-2.0.3
 
[Root @ localhost nagios-plugins-2.0.3] # ./configure --with-nagios-user = nagios --with-nagios-group = nagios
[Root @ localhost nagios-plugins-2.0.3] #make
[Root @ localhost nagios-plugins-2.0.3] #make install
 
By the following command to view the number of installed plug-ins
[Root @ localhost nagios-plugins-2.0.3] #ls / usr / local / nagios / libexec / | wc -l
Nagios is then added to the list of services to enable it to start automatically at system startup:
[Root @ localhost nagios-plugins-2.0.3] # chkconfig --add nagios
[Root @ localhost nagios-plugins-2.0.3] # chkconfig nagios on
Run the following command to verify Nagios sample configuration file:
[Root @ localhost ~] # / usr / local / nagios / bin / nagios -v /usr/local/nagios/etc/nagios.cfg
 
Open http ports in the firewall
firewall-cmd --add-service = http (instant open)
firewall-cmd --permanent --add-service = http (the configuration file)
firewall-cmd --reload (reboot the firewall)
 
Start nagios service
[Root @ localhost ~] # / usr / local / nagios / bin / nagios -d /usr/local/nagios/etc/nagios.cfg
 
After the browser can access links http://192.168.1.204/nagios, enter the login name and password, if you can see the page properly, proved the main program and plug-ins are installed and configured successfully! Click on "Service" link to view the details of your surveillance of the machine. At this point you may need to give some time for Nagios to detect your machine depend on the service.

WARNING in a state of service, so I had to configure mailbox has received an alarm message, if you do not receive a warning message, this time to check whether you have configured the mailbox to receive alarm information, and check whether as spam blocked.
Installation nrpe
[Root @ localhost src] # tar -zxf nrpe-2.15.tar.gz
[Root @ localhost src] # cd nrpe-2.15
[Root @ localhost nrpe-2.15] # ./configure --with-nrpe-user = nagios \
    --with-nrpe-group = nagios \
    --with-nagios-user = nagios \
    --with-nagios-group = nagios \
    --enable-command-args \
    --enable-ssl

[Root @ localhost nrpe-2.15] # make all
[Root @ localhost nrpe-2.15] # make install-plugin
[Root @ localhost nrpe-2.15] # make install-daemon
[Root @ localhost nrpe-2.15] # make install-daemon-config
Check / usr / local / nagios / libexec directory if you have installed the plug-check_nrpe
[Root @ localhost libexec] # ls | grep check_nrpe
check_nrpe
So far, the monitoring host has completed the installation of nagios

Install the remote host

Commonly used commands

Contents of the command

Command Format

Close nrpe

pkill nrpe

Start nrpe

/ Usr / local / nagios / bin / nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

Start nrpe (applies only to write the script nrpe case)

systemctl start nrpe.service

Check whether to activate nrpe

netstat -lnt
(5666 by checking whether the port is open)

Configuring Operating Environment

First, turn off the firewall:

[Root @ localhost ~] # systemctl stop firewalld.service

[Root @ localhost ~] # yum install gcc glibc glibc-common -y

[Root @ localhost ~] # yum install gd gd-devel openssl openssl-devel -y

[Root @ localhost ~] # yum install php php-gd perl net-tools -y

Install nagios-plugin

1) first add nagios user

[Root @ localhost ~] # useradd -s / sbin / nologin nagios # ban nagios user login

2) NRPE dependent on nagios-plugins, therefore, need to install the

Go to the next / usr / local / src directory began to execute the following command

[Root @ localhost src] # tar zxf nagios-plugins-2.0.3.tar.gz

[Root @ localhost src] # cd nagios-plugins-2.0.3

[Root @ localhost nagios-plugins-2.0.3] # ./configure --with-nagios-user = nagios --with-nagios-group = nagios

[Root @ localhost nagios-plugins-2.0.3] # make all

[Root @ localhost nagios-plugins-2.0.3] # make install

Installation nrpe

Go to the next / usr / local / src directory began to execute the following command

[Root @ localhost src] # tar -zxf nrpe-2.15.tar.gz

[Root @ localhost src] # cd nrpe-2.15

[Root @ localhost nrpe-2.15] # ./configure --with-nrpe-user = nagios \

 --with-nrpe-group = nagios \

 --with-nagios-user = nagios \

 --with-nagios-group = nagios \

 --enable-command-args \

 --enable-ssl

[Root @ localhost nrpe-2.15] # make all

[Root @ localhost nrpe-2.15] # make install-plugin

[Root @ localhost nrpe-2.15] # make install-daemon

[Root @ localhost nrpe-2.15] # make install-daemon-config

[Root @ localhost nrpe-2.15] # ls / usr / local / nagios / libexec / # If the installation is successful there are a lot NRPE plugin

Pay attention to whether check_nrpe this plug (no words to explain the nrpe not installed successfully)

Start nrpe

Method One: The command to start nrpe

[Root @ localhost ~] # / usr / local / nagios / bin / nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

# This command starts nrpe

If you want to restart nrpe, first execute the command:

[Root @ localhost ~] # pkill nrpe # Close nrpe

[Root @ localhost ~] # netstat -lnt # This command is used to check the port to see if the port has been closed 5666

[Root @ localhost ~] # / usr / local / nagios / bin / nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

# Restart process nrpe

Method Two: Create a startup script nrpe

For the startup NRPE service can be defined as the following /etc/init.d/nrpe script in the /etc/init.d directory nrpe file a new name, copy the contents into the following


#! / Bin / bash

# Chkconfig: 2345 88 12

# Description: NRPE DAEMON

NRPE = / usr / local / nagios / bin / nrpe

NRPECONF = / usr / local / nagios / etc / nrpe.cfg

case "$ 1" in

      start)

              echo -n "Starting NRPE daemon ..."

              $ NRPE -c $ NRPECONF -d

              echo "done."

              ;;

      stop)

              echo -n "Stopping NRPE daemon ..."

              pkill -u nagios nrpe

              echo "done."

      ;;

      restart)

              $ 0 stop

              sleep 2

              $ 0 start

              ;;

      *)

              echo "Usage: $ 0 start | stop | restart"

              ;;

      esac

exit 0
 

Then add permission to run:

[Root @ localhost ~] # chmod + x /etc/init.d/nrpe

Start nrpe

[Root @ localhost ~] # systemctl start nrpe.service

Check that port 5666 started successfully

[Root @ localhost ~] # netstat -tnlp

5666 port has been successfully started

Add /usr/local/nagios/etc/nrpe.cfg file monitoring host ip address

[Root @ localhost etc] # vi nrpe.cfg +81

The allowed_hosts = 127.0.0.1 modify allowed_hosts = 127.0.0.1,192.168.1.204 (which is monitoring host ip address of the machine ip address is 192.168.1.112)

Then restart nrpe

[Root @ localhost ~] # pkill nrpe

[Root @ localhost ~] # / usr / local / nagios / bin / nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

On the monitoring host (ip address 192.168.1.204) Enter the following command to check for successful communication between two machines

[Root @ localhost ~] # cd / usr / local / nagios / libexec /

[Root @ localhost libexec] # ./check_nrpe -H 192.168.1.113

NRPE v2.15 # successful communication

At this point, the remote host to install nagios completed.

Monitoring host installation PNP

Important: see you want to install pnp4nagios versions 0.4 and 0.6 because the configuration is inconsistent

Configuring the development environment

[Root @ localhost ~] # yum install rrdtool librrds-perl -y

Installation pnp4nagios (version 0.6)

Go to the next / usr / local / src directory began to execute the following command

[Root @ localhost src] # tar zxf pnp4nagios-0.6.25.tar.gz

[Root @ localhost src] # cd pnp4nagios-0.6.25

[Root @ localhost pnp4nagios-0.6.25] # ./configure --with-nagios-user = nagios --with-nagios-group = nagios

[Root @ localhost pnp4nagios-0.6.25] # make all

[Root @ localhost pnp4nagios-0.6.25] # make install

[Root @ localhost pnp4nagios-0.6.25] # make install-webconf

[Root @ localhost pnp4nagios-0.6.25] # make install-config

[Root @ localhost pnp4nagios-0.6.25] # make install-init

[Root @ localhost pnp4nagios-0.6.25] # cd ./sample-config

[Root @ localhost pnp4nagios-0.6.25] # make install-webconf

Configuration pnp4nagios

[Root @ localhost pnp4nagios-0.6.25] # cd / usr / local / pnp4nagios / etc /

[Root @ localhost etc] # mv misccommands.cfg-sample misccommands.cfg

[Root @ localhost etc] # mv rra.cfg-sample rra.cfg

[Root @ localhost etc] # mv nagios.cfg-sample nagios.cfg

[Root @ localhost etc] # cd pages /

[Root @ localhost pages] # mv web_traffic.cfg-sample web_traffic.cfg

[Root @ localhost pages] # cd ../check_commands/

[Root @ localhost check_commands] # mv check_all_local_disks.cfg-sample check_all_local_disks.cfg

[Root @ localhost check_commands] # mv check_nrpe.cfg-sample check_nrpe.cfg

[Root @ localhost check_commands] # mv check_nwstat.cfg-sample check_nwstat.cfg

[Root @ localhost check_commands] # /etc/init.d/npcd start

[Root @ localhost check_commands] # chkconfig npcd on

Configure Nagios data output interface (running in BULK mode) For more details, refer to the official website https://docs.pnp4nagios.org/pnp-0.6/config#bulk_mode:

[Root @ localhost ~] # vi /usr/local/nagios/etc/nagios.cfg


process_performance_data = 1 # 0 by default, modification of 1

And add the following content in the file

#

# Service performance data

#

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 performance data starting with Nagios 3.0

#

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
 

Configuration command.cfg

[Root @ localhost ~] # vi /usr/local/nagios/etc/objects/commands.cfg


Add the following contents in the file

define command {

      command_name process-service-perfdata-file

      command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk = / usr / local / pnp4nagios / var / service-perfdata

}

define command {

      command_name process-host-perfdata-file

      command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk = / usr / local / pnp4nagios / var / host-perfdata

}
 

Add to chart icon template configuration file template:

[Root @ localhost ~] # vi /usr/local/nagios/etc/objects/templates.cfg


Add the following contents in the file

define host {

  name host-pnp

  action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_

  register 0

}

define service {

  name service-pnp

  action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$

  register 0

}
 

Call monitor host chart templates and services (in the host service back and add a new template):

[Root @ localhost ~] # vi /usr/local/nagios/etc/objects/localhost.cfg


According to the following content modification (not add) the file

define host {

        use linux-server, host-pnp

        host_name localhost

        alias localhost

        address 127.0.0.1

        }

define service {

        use local-service, service-pnp

        host_name localhost

        service_description PING

        check_command check_ping! 100.0,20%! 500.0,60%

        }

define service {

        use local-service, service-pnp

        host_name localhost

        service_description Root Partition

        check_command check_local_disk! 20%! 10%! /

        }

...
 

Chart shows

Restart nagios and apache

[Root @ localhost ~] # systemctl restart nagios.service

[Root @ localhost ~] # systemctl restart httpd.service

Individually resolve the error. Then remove or modify the install.php file:

[Root @ localhost ~] # rm -rf /usr/local/pnp4nagios/share/install.php

Click the icon again to display the current generated by the monitoring service pnp4nagios

So far, nagios monitoring host showing the configuration has been completed.

Problems set

After the initial configuration of nagios monitoring terminal, enter the address in the browser can not connect

Possible that the firewall blocked port 80, then open the firewall to port 80:

firewall-cmd --add-service = http (instant open)

firewall-cmd --permanent --add-service = http (the configuration file)

firewall-cmd --reload (reboot the firewall)

If the following error appears:

You do not have permission to access / nagios / on this server.nagios

At this point you want to install php

yum install php -y

Then restart httpd:

systemctl restart httpd.service

But can not communicate with each other after the start nrpe

First start nrpe process

systemctl restart nrped.service

At this point you can check nrpe binding 5666 port is blocked by the firewall:

netstat -tnpl (observe whether there are one of two services below)

If port 5666 is not open on the firewall to open port 5666:

firewall-cmd --zone = public --add-port = 5666 / tcp --permanent (add 5666 port)

firewall-cmd --reload (reboot the firewall)

Or directly off the firewall

[Root @ localhost ~] # systemctl stop firewalld.service

The requested URL / pnp4nagios / graph was not found on this server after installation pnp4nagios.

Reason, when you perform the installation in pnp4nagios make install-webconf, note that it generated a apache configuration file.

You put this file: /etc/httpd/conf.d/pnp4nagios.conf All contents all added to the apache httpd.conf file Finally, restart nagios and apache should be friends.

Jump to the next /usr/local/src/pnp4nagios-0.6.25 directory Run

[Root @ nagios-test pnp4nagios-0.6.25] # make install-webconf

[Root @ nagios-test pnp4nagios-0.6.25] # cd ./sample-config && make install-webconf

[Root @ nagios-test pnp4nagios-0.6.25] # service nagios restart

[Root @ nagios-test pnp4nagios-0.6.25] # systemctl restart httpd.service

Appears "CHECK_NRPE:. Error - Could not complete SSL handshake" error

Install the development environment:

yum install openssl openssl-devel

Check nagios monitoring client allows end address and the target address is configured properly to allow nrpe. For example, by monitoring client configuration (command: vi /usr/local/nagios/etc/nrpe.cfg):

allowed_hosts = 127.0.0.1,192.168.1.112 (between two addresses only a comma, no spaces)

Executing ./configure error: configure error can not find ssl headers

The reason is the lack of openssl-devel package,

yum -y install openssl-devel

After extracting ./configure, in nagios-4.0.8 make all were given

Reported the following errors:

cd ./base && make

make [1]: Entering directory '/ tmp / nagios / base'

make [1]: *** No rule to make target '/include/locations.h', needed by 'broker.o' Stop..

make [1]: Leaving directory '/ tmp / nagios / base'

make: *** [all] Error 2

Installed perl is not out of this problem! Command is as follows:

yum -y install perl

Note that, after the need to re-install perl ./configure it, or else get the error

Executive .configure Error installing nrpe

When you install the plug-in check-nrpe monitoring host (in fact, the entire installation nrpe)

./configure prompt error:

checking for SSL headers ... configure: error: Can not find ssl headers

If you then run the command make all, it will error: make: *** no rules can create a target "all". stop.

Solution:

yum -y install openssl-devel

Remember: openssl-devel after Bahrain, to execute ./configure

Then make all

make install-plugin

Error: perfdata directory "/ usr / local / pnp4nagios / var / perfdata /" is empty.

Now a lot of information, according to the final official website http://docs.pnp4nagios.org/pnp-0.6/config Bulk mode on the reconfiguration of the PNP relevant documents (I can refer to the contents of the above will be)
     
         
         
         
  More:      
 
- Partition contrast manifestations under Windows and Linux (Linux)
- MySQL development common query summary (Database)
- IOwait Linux system monitoring diagnostic tools (Linux)
- To create a secure network firewall with iptables Under Linux (Linux)
- MySQL log from the library than the main library (Database)
- Function Getting the Linux shell (Programming)
- Linux host dual LAN transceiver package ARP problem (Linux)
- CentOS7 virtual machine settings, and bridging problems (Linux)
- Linux file and directory permissions settings (Linux)
- ASM Management - How to Rename diskgroup (Database)
- Go performed using iOS and Android programming (Programming)
- Oracle and MySQL difference between the jdbc (Database)
- WordPress blog installation Redis Cache (Server)
- PostgreSQL 9.3.5 database installation under Ubuntu Server 14.04 (Database)
- JDK tools jstat (Linux)
- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)
- Install Python 3.3.4 under CentOS 6.4 (Linux)
- To install Ganglia configuration of experience under CentOS 5.5 (Linux)
- CentOS Linux firewall configuration and Close (Linux)
- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.