LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-04-2007, 09:59 AM   #1
Mangenius
Member
 
Registered: Jan 2007
Posts: 30

Rep: Reputation: 15
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.
 
Old 01-04-2007, 10:27 AM   #2
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
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.
 
Old 01-04-2007, 10:47 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios config ? MikeFoo1 Linux - Networking 15 01-18-2013 06:26 AM
Converting Netsaint config to Nagios! dunkyb Linux - Software 2 07-20-2006 08:31 AM
configuring nagios sudheendra.ss Linux - Software 7 12-02-2005 03:47 PM
Problems with nagios config ignus Linux - Software 4 07-26-2005 08:17 AM
Nagios Config Verification Problem creighzy Ubuntu 3 04-20-2005 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration