Nagios CentOS Remote 1 – Installing The Client Components And Dependencies

Nagios CentOS Remote 1 – Installing The Client Components And Dependencies

The first part of the configuration to add a remote CentOS server to Nagios for monitoring is to install the client components and any dependencies using yum.  To install the client components and any dependencies perform the following steps :-

  • In the command line on the Remote Host execute the following command :-

yum install nagios nagios-plugins nagios-plugins-nrpe nagios-nrpe

The command above will install Nagios and some or all of the additional dependencies listed below on to the server once you accept the install :-

fping
perl-Crypt-DES
perl-Digest-HMAC
perl-Digest-SHA1
perl-Net-SNMP
perl-Socket6

Depending on the initial build of the CentOS server then some of these dependencies may not be required or may require updating as part of the yum install process.

Setting The Nagios Account Password

The next step is to set the password for the nagios user account on the Remote host as the CentOS installation already creates the account as part of the instalation.

The nagios user is used to run the nagios client components on the remote host itself but also for connection from the monitoring server.  To set the password for the nagios user perform the following steps :-

  • In the command line on the Remote Host execute the following command :-

passwd nagios

  • When prompted set the password for the user to the desired password.

Editing The Nrpe Config File

The next step in configuring the client components of nagios on the remote host is to modify the nrpe.cfg file on the server.  To modify the nrpe.cfg file on the server perform the following steps :-

·         On the Remote Host edit the file /etc/nagios/nrpe.cfg ·         Locate the line below and uncomment it by removing the # (Hash) symbol from the front of the line

#server_address=127.0.0.1
E.G. – server_address=10.20.30.40

·         Next change it to the IP address on the server you wish to bind nrpe to if you do not wish nrpe to run on all interfaces :-

server_address=127.0.0.1
E.G. – server_address=10.20.30.40

·         Next locate the line below and comment it out by adding a # (Hash) symbol to the front of the line :-

allowed_hosts=127.0.0.1
E.G. – #allowed_hosts=127.0.0.1

·         Next add a line below this as shown below where the {Monitoring Server IP} is set to the IP address of your nagios monitoring server :-

allowed_hosts={Monitoring Server IP}
E.G. – allowed_hosts=10.20.30.50

·         Next locate the line below and change it to dont_blame_nrpe=1 :-

dont_blame_nrpe=0
E.G. – dont_blame_nrpe=1

·         Next locate the INCLUDE CONFIG FILE section of the file and add the line below :- include=/etc/nagios/command-plugins.cfg ·         Save and Exit the file

Configuring The Nrpe Daemon To Start Automatically

The next step is to configure the nrpe daemon on the remote host to start automatically on boot.  To configure the nrpe daemon on the remote host to start automatically on boot perform the following steps :-

·         In the command line on the Remote Host execute the following command :-

chkconfig nrpe on

Starting The Nrpe Daemon

The final step on the Remote Host is to start the nrpe daemon and to do this perform the folliowing steps :-

·         In the command line on the Remote Host execute the following command :-

service nrpe start