Open main menu

CDOT Wiki β

Changes

How to Setup and configure Nagios

2,276 bytes added, 21:03, 17 December 2010
no edit summary
4. Install binaries, init script, sample config files and set permissions on the external command directory.
<pre>Note: you You have to be root to issue the following commands.</pre>
<code>make install </code>
Make sure you've installed the following packages on your Fedora 13 installation before continuing.
<pre>Note: you You have to be root to install the following packages.</pre>
1. Install the following packages using yum install utility.
<pre>Note: When you have installed all the required plugins, using the “yum” utility, you will have to exhibit due diligence by
ensuring that the “check_nrpe” plugin and check_nagios plugin are located in the /usr/lib64/nagios/plugins directory. If the
check_nrpe plugin is not present you will have to either copy it from a compatible machine that already contains the appropriate/or required plugin(s), or try uninstalling the previous installation of the nagios plugins and proceed to re-installing the plugins again, using yum install. </pre>
'''4.4 Nagios Configuration File'''
<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: ScriptAlias directory path will differ based on what version of OS (Operating System) you are running on your machine.</pre>
1. Edit nagios.cfg filelocated in apache (httpd) config files directory.
<code>vi /etc/httpd/conf.d/nagios.cfg </code>
<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 Installation On Arm 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-guru-4-1(Utilize the installation steps (5.0) that follow this section).'''
<pre>Note: Using the 'yum utility' install the nrpe daemon/ nrpe addon & required plugins</pre>
The nrpe.d directory is located in /etc/nagios/nrpe.d
<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:
== 5.0 Setting up the Remote Host (using yum utility) ==
<pre>Note: This part section will show how to setup the remote hosst host with the nrpe daemon/nrpe addon & required plugins.</pre>
1. To install the nrpe daemon and nagios plugins run the following commands.
<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 Hong Kong's IP Address will be used:
<code> Allowed_hosts=142.204.133.123 </code>
</pre>
4. Add a firewall rule to the INPUT chain - CAVEAT: The ARM machines do not utilize iptables, so the line below may not be required.
<code>iptables -I INPUT -p tcp -m tcp --dport 5666 -j ACCEPT</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
utilize 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 appropriate runlevels on the ARM system. Once the system is rebooted the aforementioned script will
execute automatically and perform a verification check of all devices that should be mounted on boot.</pre>
 
1. Symlinks were created using the command syntax.
 
<code>
ln -s /etc/init.d/check_mounted_disks /etc/rc/rc2.d/S50check_mounted_disks
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>
[root@cdot-guru-4-1/]#./check_mounted_disks
"OK: All disks are mounted and persistent"</code>
== 6.0 IRC Notification Bot Configuration (Server configuration) ==
1
edit