SERVICE ALERT

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
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

SERVICE ALERT

Post by vvz »

Hello!
this is my host file config

Code: Select all

define host {
        host_name               test-condor-site
        alias                   test-condor-site
        address                 172.16.37.44
        check_command           check-host-alive
        max_check_attempts      5
        check_interval          3
        retry_interval          3
        active_checks_enabled   1
        check_period            24x7
        contact_groups          admins, admins-phone, first-call
        notification_interval   3
        notification_period     24x7
        notification_options    d
        notifications_enabled   0
        event_handler           asteriks-host-phone-call
        event_handler_enabled   0
        }
define service {
        host_name               test-condor-site
        service_description     check-host-alive-or-not
        check_command           check-host-alive
        max_check_attempts      5
        check_interval          3
        retry_interval          3
        active_checks_enabled   1
        check_period            24x7
        contact_groups          admins, admins-phone, first-call
        notification_interval   3
        notification_period     24x7
        notification_options    w,c
        notifications_enabled   1
         event_handler           asteriks-service-phone-call
        event_handler_enabled   1
        }
question is - why SERVICE ALERT goes immediately to HARD state?

what else should I check?

I was expected according to my service definition - after 4 SOFT states only the 5-th should be HARD
as you can see host definition has the same options and notifications work just fine

log file

Code: Select all

May  8 14:38:27 callme-crt-billing nagios: Finished daemonizing... (New PID=41761)
May  8 14:38:57 callme-crt-billing nagios: HOST ALERT: test-condor-site;DOWN;SOFT;1;PING CRITICAL - Packet loss = 100%
May  8 14:40:07 callme-crt-billing nagios: SERVICE ALERT: test-condor-site;check-host-alive-or-not;CRITICAL;HARD;1;PING CRITICAL - Packet loss = 100%
May  8 14:40:07 callme-crt-billing nagios: SERVICE EVENT HANDLER: test-condor-site;check-host-alive-or-not;CRITICAL;HARD;1;asteriks-service-phone-call

thank you
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SERVICE ALERT

Post by slansing »

I would take a look at this page:

http://nagios.sourceforge.net/docs/3_0/statetypes.html

Specifically this:
Hard States

Hard states occur for hosts and services in the following situations:

When a host or service check results in a non-UP or non-OK state and it has been (re)checked the number of times specified by the max_check_attempts option in the host or service definition. This is a hard error state.
When a host or service transitions from one hard error state to another error state (e.g. WARNING to CRITICAL).
When a service check results in a non-OK state and its corresponding host is either DOWN or UNREACHABLE.
When a host or service recovers from a hard error state. This is considered to be a hard recovery.
When a passive host check is received. Passive host checks are treated as HARD unless the passive_host_checks_are_soft option is enabled.
Your host went down, thus triggering a hard state change on the following service checks assigned to that host.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: SERVICE ALERT

Post by vvz »

understood, thank you. I've missed this line in manual
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SERVICE ALERT

Post by tmcdonald »

Soft and Hard states can get a bit tricky. Locking topic.
Former Nagios employee
Locked