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