Page 1 of 1

RE: [Nagios-devel] Service notification commands not being execut ed

Posted: Wed Jan 02, 2002 4:54 pm
by Guest
The problem is due to the fact that you don't have any contact groups
defined for the service. The fact that you didn't get any warnings
about this is a bug on my part. I'll also fix the code so that the
notification number doesn't get incremented if there aren't any
contacts who get notified. Add something like 'contactgroup aix-
admins' to the service definition and you should be okay.


On 2 Jan 2002 at 15:47, Ewan Leith wrote:

> I've done some more investigation, found where to turn on the debugging
> (--enable-debug0 .. 4) when running configure, and added a bunch of extra
> debug code myself.
>
> The problem I am having occurs in the file common/objects.c in the function
> "is_contact_for_service".
>
> The first thing that function does is check if the variable "svc" is null,
> and if it is, then exit returning false (meaning no contacts). The code does
> pass this check on my system, svc is not null. However, the function then
> runs a for loop:
>
> for(temp_contactgroupsmember=svc->contact_groups;temp_contactgroupsmember!=N
> ULL;temp_contactgroupsmember=temp_contactgroupsmember->next){
> ...
> }
>
> As you can see, the for loop tests against svc->contact_groups indirectly by
> way of temp_contactgroupsmember. This value is null.
>
> The debugging code for svc i have inserted tells me that svc is set to:
>
>
> svc->host_name: fwma01
> svc->description: pop3
> svc->service_check_command: check_pop
> svc->contact_groups->group_name:
>
> so the values are right.
>
> Reading through the code this seems to suggest my contacts.cfg or hosts.cfg
> file is wrong - it is finding the contact ejl (me), but then deciding it is
> not a contact for that service.
>
> I've pasted the relevant parts of my configs below.
>
> The strangest part is that if the host itself goes down instead of a service
> (including the host being tested here), then it does find me as a contact.
>
> Is anyone else confused yet, because I am?
>
> If anyone has any ideas please give me a shout, as i'd quite like to dump
> bigbrother and its cpu utilisation and defunct processes.
>
> Thanks,
>
> Ewan.
>
> Config files below...
>
>
> My contacts.cfg file consists of:
>
> define contact{
> contact_name ejl
> alias Ewan
> service_notification_period 24x7
> host_notification_period 24x7
> service_notification_options c,u,w,r
> host_notification_options d,u,r
> service_notification_commands host-notify-by-email
> host_notification_commands host-notify-by-email
> email ejl
> }
>
> define contactgroup{
> contactgroup_name aix-admins
> alias AIX Administrators
> members ejl
> }
>
> the hosts.cfg file consists of (amongst others)
>
> define host{
> host_name fwma01
> alias fwma01
> address 1.1.1.1
> use fwlaix_template
> }
>
> define host {
> name fwlaix_template
> check_command check-host-alive
> max_check_attempts 1
> checks_enabled 1
> process_perf_data 1
> notification_interval 180
> notification_period 24x7
> notification_options d,u,r
> notifications_enabled 1
> register 0
> }
>
> define hostgroup{
> hostgroup_name aix-servers
> alias AIX Servers
> contact_groups aix-admins
> members fwma03,fwma01,opal,ruby
> }
>
>
> Finally, the service.cfg file consists of
>
>
> define service{
> host_name fwma03,fwma01
> service_description pop3
> check_command check_pop
> max_check_attempts 1
> normal_check_interval 3
> retry_check_interval 1
> check_period 24x7
> notification_period 24x7
> notification_interval 3
> notification_options w,u,c,r
> notifications_enabled 1
> }
>
>
>
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel@lists.sourceforge.net
> https://lists.sourceforg

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: nagios@nagios.org