20090925

Nagios

Traditionally I would build Nagios using the source but I recently found its in the yum repository (Fedora 11). "Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.". We currently rely on traditional methods of monitoring; wait for the user to become angry and report a problem manually. If you search for Nagios on yum you will find that there are a ton a plug-ins available. Using yum for this installation will help reduce the installation time and help with typical dependency issues.

My layout will include two Nagios servers monitoring 6 Windows Server 2000-2008 servers, 30 or so Xp workstations, 4 switches, 1 router, 5 to 6 printers and 3 websites. The primary monitoring server (Troy) is a Fedora 11 based system while the secondary system (Bugs) is Fedora 8.

Note that Nagios requires that you have Apache, PHP and the GD libs. All of these prerequisites can be found in yum.

I first install the nagios.i586 and nrpe.i586 packages then issue the yum install nagios* to fetch everything else. I'm sure that you could just issue yum install nagios* and get everything needed without any issues. Next you will need to edit the configuration files. I recommend a suite called Nconf. Nconf is a web based configuration tool for Nagios. I will cover Nconf in a separate document.

Next is to configure Apache. You must create a AuthUserFile so you don't have anonymous people logging in to the Nagios site. Use htpasswd -c /etc/nagios/passwd admin to create the AuthUserFile with a user name of admin. Make sure that you remember this password because you will need it to login to the Nagios web interface later. Next edit /etc/httpd/conf.d/nagios.conf to allow from any ip addresses that will need access to the web interface and make sure that the AuthUserFile is pointed to /etc/nagios/passwd.

Before starting Nagios run the verify command that checks your configuration for any issues. This command is done by using the v switch and pointing to your main config file. Example: nagios -v /etc/nagios/nagios.cfg. If the check comes back with no serious problems then you should be safe to start nagios. You can set Nagios to start during boot by issuing these two commands chkconfig --add nagios and chkconfig nagios on. Start Nagios manually by issuing the command service nagios start.

If you have problems viewing the web interface check that your firewall is allowing httpd connections. If you use SELinux in enforcing or targeted mode then you must add rules or just disable enforcing. Also check /etc/httpd/conf.d/nagios.conf is allowing the IP addresses you wish to have access to Nagios (remove deny from all).


NOTES:

Installing Nagios From YUM
yum install nagios.i586
yum install nrpe.i586
yum install nagios*

Apache Configuration
htpasswd -c /etc/nagios/passwd admin
vi /etc/httpd/conf.d/nagios.conf

Nagios Configuation
nagios -v /etc/nagios/nagios.cfg

Service Configuration
chkconfig --add nagios
chkconfig nagios on

Firewall Configuration
lokkit

SELinux Configuration
vi /etc/selinux/config

No comments: