LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   configuring nagios config files (https://www.linuxquestions.org/questions/linux-software-2/configuring-nagios-config-files-516265/)

Mangenius 01-04-2007 09:59 AM

configuring nagios config files
 
I been reading the configuration files and trying to understand the intracicies of how nagios uses said files. I have to say I am a bit of a linux newbie (and as crazy as that sounds, I'm running gentoo). The sample configuration script was ran, and I went through each cfg file. Eventually, I realized I needed to strip the object config files (i.e. services, host) to barebones and remove/modify the sample objects. I just want to add the bare minimum set of template objects to get nagios up-and-running. Once I know how to get the bare minimum configuration going, it'll be easier to expand upon it.

Anyway, this is the output after I run the following in gentoo:

etc/init.d/nagios checkconfig

Nagios 1.4.1
Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org)
Last Modified: 05-15-2006
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Error: Host 'linux-server' specified in service 'check-disk-sda1' not defined anywhere!
Error: Service check command 'check-disk' specified in service 'check-disk-sda1' for host 'linux-server' not defined anywhere!
Error: Contact group 'linux-admins' specified in service 'check-disk-sda1' for host 'linux-server' is not defined anywhere!
Checked 1 services.
Checking hosts...
Error: There are no hosts defined!
Checked 0 hosts.
Checking host groups...
Error: There are no host groups defined!
Checked 0 host groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Warning: Contact group 'nagios' is not used in any hostgroup/service definitions or host/hostgroup/service escalations!
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking host group escalations...
Checked 0 host group escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 22 commands.
Checking time periods...
Checked 4 time periods.
Checking for circular paths between hosts...
Checking for circular service execution dependencies...
Checking global event handlers...
Checking obsessive compulsive service processor command...
Checking misc settings...

Total Warnings: 1
Total Errors: 5

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation on the main and host config files, as well as the
'Whats New' section to find out what has changed.

* Configuration Error. Please fix your configfile


This is what i have listed in the services.cfg file:

define service{
host_name linux-server
service_description check-disk-sda1
check_command check-disk!/dev/sda1
max_check_attempts 5
normal_check_interval 5
retry_check_interval 3
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
contact_groups linux-admins
}

It's the same as the sample data, but I want to initially figure out how can I get nagios running leaving this as is. I would really appreciate if anyone can help me out. Thank you in advance for any advice.

asommer 01-04-2007 10:27 AM

There's a couple of articles on OnLAMP about Nagios:

http://www.onlamp.com/pub/a/onlamp/2...05/nagios.html

This is the first one. I read through them when I initially started using Nagios and they really taught me a lot. I recommend giving them a read because they should help you understand the config files better.

From the errors you're getting you need to define "check-disk" command and the "linux-admins" group. You could try commenting those sections out in the config files.

unSpawn 01-04-2007 10:47 AM

I agree that (as bad as it sounds) configuring Nagios does start with a big chunk of RTFM. Next to nagios.cfg and the services.cfg you'll want to change info in contact*.cfg and host*.cfg's (and dependencies.cfg escalations.cfg) because a network is a container for a herd of hosts, a host is a container for a flock of services meaning a service is nothing itself unless it's herded by a host. Maybe it has to do with applying structure to chaos. dunno.


All times are GMT -5. The time now is 05:23 AM.