Changes

Jump to: navigation, search

How to Setup and configure Nagios

219 bytes removed, 08:46, 8 December 2010
no edit summary
Normal 0 false false false EN-US X-NONE X-NONE == 5.0 Setting up the Remote Host (using yum utility)==
 <pre>Note: This part will show how to setup the remote hosst with the nrpe daemon/nrpe addon & required plugins.  </pre>
1. To install the nrpe daemon and nagios plugins run the following commands.
<code>yum –y install nrpe yum -y install Nagios-plugins-all</code>
<code>yum -y install Nagios-plugins-all</code>
2. Open nrpe.cfg and edit it with your favourite editor.
 <code>vi /etc/nagios/nrpe.cfg  </code>
Add an allowed_hosts IP Address to nrpe.cfg file eg. 142.204.133.123 (chile’s IP Address):
 <code>Allowed_hosts=142.204.133.123  <code>
3. Test the nrpe daemon locally using the command:
<code>netstat -at | grep nrpe</code>
netstat -at | grep nrpe   <pre>Note: The output of the command should look something like this: 
tcp 0 0 *:nrpe *:* LISTEN
  </pre>
4. Add a firewall rule to the INPUT chain
 <code>iptables -I INPUT -p tcp -m tcp --dport 5666 –j ACCEPT  </code>
5. Save the firewall settings so it survives reboot
 <code>service iptables save   Note: Files locations after install:<code>
/etc/nagios -<pre> contains the nrpe.cfgNote: Files locations after install:
<code>/etc/nrpe.d nagios/<code> -> contains the daemonnrpe.cfg
<code>/usretc/lib64nrpe.d</nagios/plugins code> -> contains all plugins added during installthe daemon
<code>/usr/sbinlib64/nagios/plugins</nrpe code> -> contains the nrpe execution fileall plugins added during install
<code>/usr/sharesbin/docsnrpe</nrpe-2.12 code> -> contains the related README, Changelog files and .pdf etcnrpe execution file
<code>/usr/share/docs/nrpe-2.12</code> -> contains the related README, Changelog files and .pdf etc
</pre>
 
6. Check to make sure the NRPE daemon is functioning properly. To accomplish this, run the check_nrpe plugin that was installed for testing purposes. The directory make be different depending OS.
 <code>/usr/local/nagios/libexec/check_nrpe -H localhost <ip of the Remote host>  </code>
Or
 <code>/usr/lib64/naigos/plugins/check_nrpe -H localhost <ip of the Remote host>  </code>
7. Some of these commands can be executed on the Remote host for testing daemon functionality
 <code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_users </usr/local/nagios/libexec/check_nrpe -H localhost -c check_load /usr/local/nagios/libexec/check_nrpe -H localhost -c check_hda1 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs /usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs           code>
<code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_load</code>
<code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_hda1</code>
<code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs</code>
<code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs</code>
1
edit

Navigation menu