notification_options requirement

Rob Brown dtownrobbrown at gmail.com
Thu Oct 4 19:39:55 CEST 2007


Hi all,
I posted this over in the nagios-users list and only got one response
from someone with the same issue. I figured you all are probably the
ones to bounce it off of to see if there is a possible fix.
Basically, according to the docs, notification_options is a required
directive in a service definition, but does not generate an error if
omitted. Seems like it should. Makes it hard to troubleshoot if that
directive is missing.
Can you make that a requred directive and throw an error if missing?
Thanks.


-----Original Message-----
From: Aaron Devey [mailto:adevey at omniture.com]
Sent: Wednesday, October 03, 2007 12:21 PM
To: Rob Brown
Subject: Re: [Nagios-users] no error if missing notification_options

I had this exact same problem last week with nagios 2.9.  It's a pain to
track down since everything looks right.  The default of "no alerts" if
the notification_options aren't set seems like a bad default.  If
nothing else, emitting a warning during the config check (nagios -v
nagios.cfg) would be helpful.

-Aaron

Rob Brown wrote:
>
> Recently, I messed up my (version 2.2) configs and it took me a while
> to figure out why I wasn't getting any alerts: turns out the scripts I
> use to generate my configs were not writing out the
> notification_options directive on my templates. Even though I had
> notifications enabled everywhere, I was not getting alerts.
> While admittedly, this was my problem and not Nagios', it would have
> been nice to see a warning in the verification routine. Like:
> Warning: service xyz has no notification options enabled.
> That would have tipped me off right away.
>
> I checked this against a 3.0b2 version i'm running on a dev server and
> it seemed to exhibit the same behavior. According to the docs, I
> thought notification_options was a required directive? In that case,
> shouldn't it throw an error?
>
> here's a snippit of a config that passes verify:
>
> define service {
>        name                            generic-service
>        max_check_attempts              3
>        normal_check_interval           30
>        retry_check_interval            15
>        active_checks_enabled           1
>        passive_checks_enabled          1
>        check_period                    24x7
>        parallelize_check               1
>        freshness_threshold             0
>        flap_detection_enabled          1
>        retain_status_information       1
>        retain_nonstatus_information    1
>        notification_period             24x7
>        notifications_enabled           1
>        register                        0
> }
>
> define service {
>        hostgroup_name                  zzdummy
>        service_description             zzdummy
>        use                             generic-service
>        check_command                   check_dummy
>        contact_groups                  nagios_dev
> }
>
> notice in the template: no notification_options
> no alerts will ever be sent for this service.
> Is this a bug or am I missing something?
>

-------------------------------------------------------------------------
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