Nagios Bug and Feature Tracker

All issues moved to NagiosEnterprises Github

Bug and Feature Tracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000562 [Nagios Core] Core major always 2014-01-20 17:50 2016-09-07 12:25
Reporter millisa View Status public  
Assigned To jfrickson
Priority normal Resolution fixed  
Status resolved   Product Version 4.0.1
Summary 0000562: Service Parents does not appear to be functioning as intended
Description This issue has been discussed and documented in the forums at:
http://support.nagios.com/forum/viewtopic.php?f=7&t=25105 [^]

Generally, it appears that the new 'parents' attribute in the service definitions does not appear to be functioning as documented. The documentation indicates it should work similar to host parents when it comes to reachability and notification, however, in testing with both 4.0.1 and 4.0.2 it does not appear to be having an effect.


Using a test case of an HTTP service check using an SSH service check as the parent on the same host with notification_options of wcr, the child service still notifies when the parent service is already in a critical state (acknowledged or otherwise).

The forums thread above has the entirety of the config files used for the test. The following is the part that matters in the test:

define host{
   use linux-server
        host_name nagiostestb
        alias nagiostestb
        address 192.168.176.42
        }

define command{
        command_name check_http
        command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }
define service{
        use generic-service
        host_name nagiostestb
        service_description HTTP
        check_command check_http
        }

define command{
        command_name check_http_index_for_hello
        command_line $USER1$/check_http -I $HOSTADDRESS$ -w 5 -c 10 -t 45 -u/index.html -rhello
        }
define service{
        use generic-service
        host_name nagiostestb
        service_description HTTP-INDEX-HI
        check_command check_http_index_for_hello
        parents HTTP
        }


With the above config, the SSH service was stopped and allowed to reach a hard-critical state and send out its notification. Then, the child HTTP service was stopped so it would also be allowed to go into a hard-critical state. The expectation was that the notification would be suppressed with the service probably in an unreachable state. Instead, the child service did continue to notify and went into a hard-critical state.

Nagios log from the test:
[1389993378] SERVICE ALERT: nagiostestb;HTTP;CRITICAL;SOFT;1;Connection refused
[1389993438] SERVICE ALERT: nagiostestb;HTTP;CRITICAL;HARD;2;Connection refused
[1389993438] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993498] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993552] SERVICE ALERT: nagiostestb;SMTP;CRITICAL;SOFT;1;Connection refused
[1389993558] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993612] SERVICE ALERT: nagiostestb;SMTP;CRITICAL;HARD;2;Connection refused
[1389993612] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;SMTP;CRITICAL;notify-service-by-email;Connection refused
[1389993618] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused

Other tests using the Parents attribute in services does not appear to change any nagios behavior. Service dependencies that suppressed notifications and setup child-parent type relationships do continue to work in the manner and config that nagios 3.5 used.

This was tested on CentOS6.4 and CentOS6.5 with nagios 4.0.1 and nagios 4.0.2. Nagios 4.0.0 was not tried.

Unsure if this was to be categorized in 'core' or possibly 'config'. Reporting this as 'major' as suggested in the support forum thread.
Additional Information
Tags No tags attached.
Nagios Version 4.0.2 and 4.0.1
OS CentOS 6.5 x86_64
OS Version 6.5 x86_64
Attached Files ? file icon fix_service_parents.patch [^] (1,798 bytes) 2016-06-29 08:56

- Relationships

-  Notes
(0001090)
millisa (reporter)
2014-01-20 17:54

Ack, I copied and pasted the wrong set of configs that simplified the issue.

Use this as the example config with the 'SSH' and 'HTTP' tests (the initial report was from the first set of tests that used an http content check).

define command{
        command_name check_http
        command_line $USER1$/check_http -I $HOSTADDRESS$
        }
define service{
        use generic-service
        host_name nagiostestb
        service_description HTTP
        check_command check_http
        }

define command{
        command_name check_smtp
        command_line $USER1$/check_smtp -H $HOSTADDRESS$
        }
define service{
        use generic-service
        host_name nagiostestb
        service_description SMTP
        check_command check_smtp
   parents HTTP
        }


With the logs as show above:
[1389993378] SERVICE ALERT: nagiostestb;HTTP;CRITICAL;SOFT;1;Connection refused
[1389993438] SERVICE ALERT: nagiostestb;HTTP;CRITICAL;HARD;2;Connection refused
[1389993438] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993498] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993552] SERVICE ALERT: nagiostestb;SMTP;CRITICAL;SOFT;1;Connection refused
[1389993558] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
[1389993612] SERVICE ALERT: nagiostestb;SMTP;CRITICAL;HARD;2;Connection refused
[1389993612] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;SMTP;CRITICAL;notify-service-by-email;Connection refused
[1389993618] SERVICE NOTIFICATION: nagiosadmin;nagiostestb;HTTP;CRITICAL;notify-service-by-email;Connection refused
(0001091)
millisa (reporter)
2014-01-20 17:57

Much embarrassment...
Make that:
The *SMTP* check was made dependent on HTTP.
(0001346)
swilkerson (administrator)
2015-02-18 13:46

Can you post your definition for generic-service template? Being you are getting a message every failed check it makes me believe you have is_volitile set to 1 or something.
(0001577)
lev (reporter)
2016-06-29 09:03

I noticed that the service parents are realized only in config parsing but not in the service check scheduling logic. So I suggest the patch fixing the problem for me.
(0001637)
jfrickson (manager)
2016-09-07 12:25

I applied and tested lev's patch. The fix is in branch 'maint' via commit https://github.com/NagiosEnterprises/nagioscore/commit/15ec4b5d5d12804af796d072beec799cc297008e [^]

- Issue History
Date Modified Username Field Change
2014-01-20 17:50 millisa New Issue
2014-01-20 17:50 millisa Nagios Version => 4.0.2 and 4.0.1
2014-01-20 17:50 millisa OS => CentOS 6.5 x86_64
2014-01-20 17:50 millisa OS Version => 6.5 x86_64
2014-01-20 17:54 millisa Note Added: 0001090
2014-01-20 17:57 millisa Note Added: 0001091
2014-01-20 17:58 millisa Issue Monitored: millisa
2014-04-19 17:12 estanley Status new => assigned
2014-04-19 17:12 estanley Assigned To => estanley
2015-02-18 13:46 swilkerson Note Added: 0001346
2016-06-29 08:56 lev File Added: fix_service_parents.patch
2016-06-29 09:03 lev Note Added: 0001577
2016-06-29 09:04 lev Issue Monitored: lev
2016-09-07 12:24 jfrickson Assigned To estanley => jfrickson
2016-09-07 12:25 jfrickson Note Added: 0001637
2016-09-07 12:25 jfrickson Status assigned => resolved
2016-09-07 12:25 jfrickson Fixed in Version => 4.2.2
2016-09-07 12:25 jfrickson Resolution open => fixed


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker