Checking for required elements

Ethan Galstad nagios at nagios.org
Fri Oct 19 17:05:46 CEST 2007


Shad L. Lords wrote:
> I've been noticing some strange behavior with nagios 3.0b checking for 
> required elements.  It appears that some of the checks aren't working as 
> expected.  I've been trying to determine when things aren't working so I can 
> send some sample configs.
> 
> When setting up some hosts I noticed that if I don't have a 
> notification_period defined that it doesn't complain or give any warnings. 
> In the documentation this field is listed as required.

The config verification should produce a warning.  Its not a real error, 
as Nagios will simply assume that any time is valid for 
notifications/checks if a timeperiod isn't specified.  The docs need an 
update I guess.

> 
> Also if I specify a host_groups and put in a hostgroup that doesn't exist I 
> get an error right after "Reading configuration data..." but it then 
> continues on.  At the bottom it will show total error/warnings both at 0 and 
> will still load.

I think the patch I just committed for the servicegroups error you 
mentioned earlier also fixes this bug.

> 
> Finally in trying to duplicate this I was trying to come up with a minimal 
> config and found one that would cause a Segmentation fault during checking 
> contacts.  Here it is:
> 
> define contact {
>         contact_name                    test
>         service_notification_commands   command
>         host_notification_commands      command
>         }
> 
> define command {
>         command_name    command
>         command_line    echo test
>         }
> 
> define host {
>         host_name               host
>         max_check_attempts      1
>         }
> 
> define service {
>         service_description     service
>         host_name               host
>         check_command           command
>         max_check_attempts      3
> }
> 
> Thanks for your great work,
> 
> -Shad 
> 
> 

I tested this tiny config and it worked okay - got warnings about 
missing timeperiods and it didn't segfault.  Try the latest CVS when you 
get a chance to see if that fixes any problems you were having.


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/




More information about the Developers mailing list