Service Depedency issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
chimborah
Posts: 33
Joined: Tue Oct 02, 2012 7:55 am

Service Depedency issue

Post by chimborah »

Hi All,

I have defined service depedency as below on 12/02/2014. The problem is that Last check of all the service (service1, service2, service3....... ) is showing only 12/02/2014 but last check for Check_NRPR_Version is up to date. Is it that all my services are not monitored since 12/02/2014 or I have done someting wrong here. Can you please suggest.
(Status of all the services are green)

define servicedependency{
host_name XYZ
service_description Check_NRPE_Version
dependent_host_name XYZ
dependent_service_description service 1, service 2, service 3.........
execution_failure_criteria o
notification_failure_criteria w,u,c
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Service Depedency issue

Post by slansing »

Are these all of your hosts/services, or just a select group of services under a certain host? Can you provide an image of the service details pages of one of these services, and also it's configuration?
chimborah
Posts: 33
Joined: Tue Oct 02, 2012 7:55 am

Re: Service Depedency issue

Post by chimborah »

Its a group of services under one host. As I have revert the changes there is no screen shot available. Only check_NRPE_version is getting checked in regular interval (Last Check is up to date ) rest all the services were showing 12/02/2014 (Last Check is not upto date)

Code: Select all

define host{
        name                    hhhh-linux-server        ; The name of HBC host template
        use                     linux-server            ; This template inherits other values from linux-server
        check_period            24x7                    ; By default, Linux hosts are checked round the clock
        check_interval          5                       ; Actively check the host every 5 minutes
        retry_interval          1                       ; Schedule host check retries at 1 minute intervals
        max_check_attempts      5                       ; Check each Linux host 10 times (max)
        check_command           check-host-alive        ; Default command to check if servers are "alive"
        notification_period     workhours               ; Only notify during the day
        notification_interval   120                     ; Resend notifications every 2 hours
        notification_options    d,u,r                   ; Only send notifications for specific host states
        contact_groups          hhhh-admins              ; Notifications get sent to the admins by default
        register                0                       ; DONT REGISTER THIS DEFINITION, ITS JUST A TEMPLATE!
        }

define service{
        name                    hhhh-service             ; The name of this service template
        use                     generic-service         ; Inherits other values from generic-service template
        max_check_attempts      10                       ; Re-check service 4 times to get its final(hard) state
        normal_check_interval   5                       ; Check service every 5 min under normal conditions
        retry_check_interval    1                       ; Re-check service every min until a hardstate can be determined
        notification_options    w,c,r
        contact_groups          hhhh-admins              ; Notifications get sent to the admins by default
        servicegroups           hhhh-linux-services-group
        hostgroup_name          hhhh-linux-servers
        register                0                       ; DONT REGISTER THIS DEFINITION, ITS JUST A TEMPLATE!
        }
define servicedependency{
        host_name                  Host1
        service_description        Check_NRPE_Version
        dependent_host_name        Host1
        dependent_service_description   check_cpu,Critical_Processes,Disk_Filesystem,Disk_Inodes,Zombie_Processes,check_ram,check_swap
        execution_failure_criteria      o
        notification_failure_criteria   w,u,c
}

One of the Service: 
define service {
        use                             hhhh-service         ; Name of service template to use
        service_description             Disk_Filesystem_Usage
        check_command                   check_nrpe_7arg!check_fs_space!20%!10%
}
Thanks
Chim
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Service Depedency issue

Post by tmcdonald »

The reason your check_NRPE_version is still running is because the services it depends on are showing OK as of their last check, regardless of when that last check was. My guess is that somewhere around Feb 14 of this year a change was made which caused those checks to stop running.

Also, two things: Please use code wraps when posting things like this (I edited your last post as an example), and I will be moving this thread out of development because that is not the proper subforum for this topic.
Former Nagios employee
chimborah
Posts: 33
Joined: Tue Oct 02, 2012 7:55 am

Re: Service Depedency issue

Post by chimborah »

There was no other changes in nagios. Only multiple dependent services are not getting checked.I am not sure if I have missed any in the service dependency defination.

Thanks,
Chim
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Service Depedency issue

Post by tmcdonald »

I would look through your configs and double-check the dependencies. They can be a tricky web when they get beyond a simple one-to-one relationship. Check the last checked time of the one host they rely on to make sure it really is being checked by Nagios.
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Depedency issue

Post by lmiltchev »

Unless I am wrong about it, it seems this is a default behavior. You have:

Code: Select all

define servicedependency{
host_name XYZ
service_description Check_NRPE_Version
dependent_host_name XYZ
dependent_service_description service 1, service 2, service 3.........
execution_failure_criteria o
notification_failure_criteria w,u,c
}
so service1, service 2, and service 3 depend on "Check_NRPE_Version". The "execution_failure_criteria" = "o" (OK), so if "Check_NRPE_Version" is in "OK" state, the dependent services won't be actively checked...
Servicedependency - execution failure criteria

This directive is used to specify the criteria that determine when the dependent service should not be actively checked. If the master service is in one of the failure states we specify, the dependent service will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas):
o = fail on an OK state,
w = fail on a WARNING state,
u = fail on an UNKNOWN state,
c = fail on a CRITICAL state, and
p = fail on a pending state (e.g. the service has not yet been checked).
If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be actively checked (if other conditions allow for it to be).

Example: If you specify o,c,u in this field, the dependent service will not be actively checked if the master service is in either an OK, a CRITICAL, or an UNKNOWN state.

Parameter name: execution_failure_criteria
Required: no
Be sure to check out our Knowledgebase for helpful articles and solutions!
chimborah
Posts: 33
Joined: Tue Oct 02, 2012 7:55 am

Re: Service Depedency issue

Post by chimborah »

Many Thanks for your explanation. This resolves my issue :) :) :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Service Depedency issue

Post by tmcdonald »

Glad to hear! We'll be locking this now, but feel free to open up another thread if need be.
Former Nagios employee
Locked