Page 1 of 1

Notification issue on mail

Posted: Mon Oct 06, 2014 8:29 am
by shailu2014
Hi,

I have deployed the Nagios Core in my company to monitoring windows server with notification setup, some time not able to get the notification of servers on mail and it is WARNING SOFT showing in logs, which mentioned below

[10-06-2014 09:40:48] SERVICE ALERT: ivpqa2;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 0.53 ms
[10-06-2014 09:38:48] SERVICE ALERT: ivpqa2;PING;WARNING;SOFT;1;PING WARNING - Packet loss = 0%, RTA = 325.88 ms


Kindly let me know why not able to get the notification on mail.

Thanks,
Sjain

Re: Notification issue on mail

Posted: Mon Oct 06, 2014 9:49 am
by tmcdonald
Notifications will only be sent on a HARD state, not a SOFT state:

http://askubuntu.com/questions/476640/i ... ios-core-4
http://nagios.sourceforge.net/docs/3_0/statetypes.html

What do you have set for the max_check_attempts on that service? Whatever that value is, that's how many SOFT states need to be hit before it is a HARD state and an alert is sent.

Re: Notification issue on mail

Posted: Wed Oct 08, 2014 11:41 pm
by shailu2014
Hi tmcdonald ,

Pls let me know if there is any issue with my define service & define host file mentioned below,

5 Soft states get in the Even logs and then getting Hard state log notification, So It is possible that not get the soft alert on log and get the direct Hard notification alert on mail.

Define Service File

Code: Select all

define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 2 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r,f ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 5 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Define Host file

Code: Select all

define host{
name windows-server ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, Windows servers are monitored round the clock
check_interval 2 ; Actively check the server every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 5 ; Check each server 10 times (max)
check_command check-host-alive ; Default command to check if servers are "alive"
notification_period 24x7 ; Send notification out at any time - day or night
notification_interval 2 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
hostgroups windows-servers ; Host groups that Windows servers should be a member of
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}

Any help will be greatly appreciated!


Thanks,
Sjain

Re: Notification issue on mail

Posted: Thu Oct 09, 2014 4:55 pm
by tmcdonald
I'm not sure I understand what you are asking. Your configs look valid, so could you perhaps restate your question?

Re: Notification issue on mail

Posted: Thu Oct 09, 2014 8:45 pm
by shailu2014
As per the configuration 5 Soft states get in the Even logs and then getting Hard state log notification, So I want that SOFT log should not come and direct get the HARD alert notification by mail.

Thanks,
Sjain

Re: Notification issue on mail

Posted: Fri Oct 10, 2014 12:42 pm
by tmcdonald
The max_check_attempts value determines how many SOFT states are logged. If you have it set to 5, then 4 SOFT states will occur before the 5th check becomes a HARD state (assuming all the checks return the same state). If you want it to be a HARD state right away, change max_check_attempts to 1. Bear in mind, this can cause a lot of false positives because Nagios is now acting on the first non-OK state and assuming it is a real problem and not just a temporary thing.

Re: Notification issue on mail

Posted: Fri Oct 10, 2014 1:29 pm
by shailu2014
Thanks for reply, I got your point, If it is possible to change max_check_attempts 5 to 2 and it will check two SOFT and then send the HARD alert.

It is fine for us, Right ?

Thanks,
Sjain

Re: Notification issue on mail

Posted: Fri Oct 10, 2014 1:36 pm
by tmcdonald
It should log a single SOFT state for the first non-OK check, then a single HARD state for the second non-OK check. Read the following for specifics:

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

Re: Notification issue on mail

Posted: Fri Mar 27, 2015 3:26 am
by shailu2014
My issue resolved,

Thanks & appreciate for help.

Sjain