New to Nagios

Hello,

I’m very new here as I’m very new Nagios, but our company currently is implementing the program to monitor our network. I would like to learn how to setup the configuration files so that we can include various host groups. I’m reading through the documentation from the Nagios website; I’ve successfully installed the program per the quickstart guide. I’ve taken a look at another server which has Nagios installed on it, but it’s not helping me understand the configuration files and what I need to do to properly configure them. Any help would be greatly appreciated. Thank you. :slight_smile:

EDIT: I’m running version Nagios 3.0.6 on CentOS RHEL 5.1. I used the FC6 instructions for my installation.

Ok, here’s a problem: When I try to create an alternate directory (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR when I try to restart the service. I would like to use /opt/nagios/etc/main to hold all the config files. Here is a list of that directory right now:

[root@ ~ main]# ls -l total 68 -rwxrwxr-x 1 nagios nagios 7714 Feb 13 16:55 commands.cfg -rwxrwxr-x 1 nagios nagios 2166 Feb 13 16:52 contacts.cfg -rwxrwxr-x 1 nagios nagios 240 Feb 13 14:28 hostgroups.cfg -rwxrwxr-x 1 nagios nagios 163 Feb 13 16:51 hosts.cfg -rwxrwxr-x 1 nagios nagios 2414 Feb 13 16:39 services.cfg -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg -rwxrwxr-x 1 nagios nagios 3209 Feb 13 16:55 timeperiods.cfg [root@ ~ main]# service nagios restart Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.

I’ve hashed out all the other cfg in nagios.cfg to only use this directory.

[code][root@ ~ main]# grep cfg_ /usr/local/nagios/etc/nagios.cfg

cfg_file=/usr/local/nagios/etc/objects/commands.cfg

cfg_file=/usr/local/nagios/etc/objects/contacts.cfg

cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg

cfg_file=/usr/local/nagios/etc/objects/templates.cfg

cfg_file=/opt/nagios/etc/commands.cfg

cfg_file=/opt/nagios/etc/contacts.cfg

cfg_file=/opt/nagios/etc/timeperiods.cfg

cfg_file=/opt/nagios/etc/templates.cfg

cfg_file=/usr/local/nagios/etc/objects/localhost.cfg

cfg_dir=/opt/nagios/etc/main
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg

extension) in a particular directory by using the cfg_dir

#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers

object configuration files (see the cfg_file and cfg_dir options above).[/code]

What could I be doing wrong? I went out and bought the Nagios System and Network Monitoring from the bookstore last night.

From this view, everything looks fine. Have you made sure that the nagios account (or whatever account you have running the nagios service) has access to that directory and everything in it? Shot in the dark but best guess with the limited amount of information.