Monday, August 3, 2009

Notes to remembers when Installing Nagios 3.x on CentOS 5

This is a follow-up of the article of Using Nagios 2.x & 3.x on CentOS 5. If you follow closely you should get it up and running.

Some Issues to note during configuration


Note 1: First install EPEL. You can follow the following Blog Entry Red Hat Enterprise Linux / CentOS Linux Enable EPEL Repository


Note 2: Yum install nagios and all the plugins # yum install nagios, nagios-plugins-all, nagios-nrpe
(You will see not only nagios 3.x installing but also 55+ plugins too)


Note 3: Configure Objects Configuration File
(Make sure you include all the configuration file you are using to be listed)

OBJECT CONFIGURATION FILE(S)
cfg_file=/etc/nagios/contactgroups.cfg
cfg_file=/etc/nagios/contacts.cfg
cfg_file=/etc/nagios/hostgroups.cfg
cfg_file=/etc/nagios/hosts.cfg
cfg_file=/etc/nagios/services.cfg
cfg_file=/etc/nagios/timeperiods.cfg


Note 4: Make hosts.cfg file and fill up the information
define host{
use windows-server
host_name xxxx
alias xxx Web Server
check_command check_http
address www.xxx.com.sg
contact_groups admins
}



Note 5: Make the hostgroups.cfg and fill up the information
define hostgroup{
hostgroup_name windows-servers
alias Windows Servers
members xxxxx
}


Note 6: Define services.cfg to command.cfg and hostgroup.cfg
(Look at http://wiki.centos.org/HowTos/Nagios for more information)
Remember to list the services you wish to implement for nagios. It will interact with command.cfg, hostgroups.cfg to enable the service. Thus command.cfg and hostgroups.cfg must be properly written

define service{
use generic-service
service_description HTTP
notification_options n
check_command check_http
contact_groups admins
hostgroup_name windows-servers,linux-servers
}


Note 7: Test the nagios configuration before updating the services
# cd /etc/nagios/nagios -v nagios.cfg

2 comments:

Unknown said...

Hi,

I read your post on installing Nagios 3.x from EPEL.
As far as I can tell, Nagios 3 is not currently availabe, as the EPEL team is deciding how to best deliver Nagios 3 without breaking Nagios 2 installations, as the configuration files may be incompatible between versions 2 and 3. (see the thread at http://osdir.com/ml/epel-devel-list/2009-07/msg00027.html)

yum tells me nagios.x86_64 is available in version 2.12-6.el5 from the epel repo.

So I'm wondering if you could provide some hints on where to get nagios 3 from a repo such as epel.

Thanks!

Daniel

kittycool said...

Hi Daniel,

Thank you for the comments. You are right, Nagios 3.06 is not available at EPEL this point in writing.

When I wrote this blog, it was available at EPEL for a short period. Hence I have managed to install a running Nagios 3.06 on my Linux Box. Both version of Nagios were provided at EPEL (3.06 and 2.12)then. And Nagios 3.06 was installed with the method prescribe in the blog entry.

Thanks for the alert.