Open main menu

CDOT Wiki β

Changes

How to Setup and configure Nagios

879 bytes added, 21:03, 17 December 2010
no edit summary
<pre>
Note: Here is view of what your configuration files should look like, in order to have successfully installed and configured version of
Nagios. The following lines were either added or modified for the nagios.cfg file on the Nagios monitoring host.
</pre>
</pre>
<code>#Allowed_hosts=127.0.0.1</code> is typically altered on the Remote host ONLY changes in IP address that allows a host to access the nrpe daemon system depends on an entitiesentity/organizations network requirements.
<pre>
check_nrpe plugin. Open the sample commands.cfg file for editing...</pre>
<code>vi /usr/localetc/nagios/etcobjects/commands.cfg</code>
and add the following definition to the file:
You are now ready to start adding services that should be monitored on the remote machine to the Nagios configuration...
'''4.6 Edit the localhost.cfg filelocated in the /etc/nagios/objects directory'''
<pre>Note: The localhost .cfg file can be created from one of the templates.cfg files located in the /etc/nagios/objects
directory, here is a brief view of how your localhost.cfg file should appear</pre>
1. Edit contacts.cfg file is pretty straight forward and easy to decipher.
<code>vi /usr/localetc/nagios/etc/objects/contacts.cfg</code>
<pre>
<pre>Note: The current machine has Fedora 13, however, for a machine running Fedora 12 it may differ eg. ScriptAlias /nagios
/cgi-bin “/usr/lib64/nagios/cgi-bin/” It's important that these directory paths exist and contain the appropriate content.
</pre>
<code></Directory></code>
'''4.9 Note: This section highlights a brief snippet of two critical detailed steps REQUIRED for the installation and successful configuration of a Remote host (on an ARM machine) Cdot-gurguru-4-1 (Utilize the installation steps (5.0) that follow this section).'''
<pre>Using the 'yum utility' install the nrpe daemon/ nrpe addon & required plugins</pre>
<code>vi /etc/nagios/nrpe.cfg</code>
Note: Hong Kong has two NICs so the allowed_hosts entry would be entered twice with the two corressponding IPs for both NICs <code>allowed_hosts=<Both the External & Internal IP Address to that of for the monitoring hosts> </code>
comment out the line:
<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), but for future configurations HongKongHong Kong's IP Address will be used:
<code> Allowed_hosts=142.204.133.123 </code>
<code>/usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs</code>
 
8. At this point your installation and configuration of both the Nagios monitoring host and Remote host should be completed successfully. First ensure that your apache server and nagios is running on the corresponding monitoring host. To achieve a Frontend (GUI) view of Nagios functionality, go to your browser address field and type in the url-> http://<ip address of monitoring host goes here>/nagios. At the authentication prompt enter the username and password you set during the installation process.
== 5.1 Additional Details ==
<pre>This section will discuss some additional initiatives that were implemented on the Nagios Remote host. Due to the inability to obtain
a plugin that is capable of monitoring mounted devices (on ARM machines) upon boot. A supplemental perl script was identified and utilizedutilize for this purpose. The check_mounted_disks script was conveniently added to /etc/init.d directory, and a few symlinks (soft links)were linked to a few appropriate runlevels on the ARM system. Once the system is rebooted the aforementioned script willexecute automatically and perform a verification check of all devices that should be mounted on boot.</pre>
1. Symlinks were created using the command syntax.
ln -s /etc/init.d/check_mounted_disks /etc/rc/rc2.d/K50check_mounted_disks</code>
2. When the check_mounted_disks script is executed on the command line, the following results are exhibited on the display monitor:
<code>
1
edit