Notification period

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
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Notification period

Post by MPIvan »

Hi all,
i have problem with the notification period ... im trying to set time about notification but i cant make it ... im getting mail on every 30 min. But i have nowhere configure that timer and i cant find out where it is ... i have the following ....
define host{
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction 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
notification_period 24x7 ; Send host notifications at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

define contact{
name generic-contact ; The name of this c$
service_notification_period 24x7 ; service notificati$
host_notification_period 24x7 ; host notifications$
service_notification_options w,u,c,r,f,s ; send notifications$
host_notification_options d,u,r,f,s ; send notifications$
service_notification_commands notify-service-by-email ; send service notif$
host_notification_commands notify-host-by-email ; send host notifica$
register 0 ; DONT REGISTER THIS$
}

define host{
name router-in
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_options d,u,r
hostgroups routers-zgrada
register 0
}

define host{
use router-in
host_name RouterCiscoT
alias Test Cisco SNMP
address 192.168.1.1
_SNMPCOMMUNITY TestCisco
contacts Ivan
}

define contact{
use generic-contact
contact_name Ivan
alias mp ivan contact
email mpivan@mydomain.com
host_notification_options d,u,r
host_notifications_enabled 1
service_notifications_enabled 0
}
and timeperiods.cfg file is default, i have not change there nothing ... so why is nagios send me mail notification on every 30 min ... i would like for test and for some routers to gave me notification when the router is down and next when the router is up
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Notification period

Post by slansing »

MPIvan you may want to take a read over some of our configuration documentation:

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

http://nagios.sourceforge.net/docs/3_0/ ... .html#host

This will show you how to properly add notification intervals.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Notification period

Post by MPIvan »

yes i read that part ... and yes i have change the notification_interval the problem is that i even comment the "# notification_interval "in the host template part .... but nothing he still send me notifications every 30 min .... now instead of 30 i put 0 and it is ok .... so my question is where else is this interval store because i cant find it ... in template.cfg file is not and if it is i comment everywhere i can find ... in my host.cfg files also... i search in contacts and services .cfg files also not there and even in the nagios.cfg file i have search and found that notification_interval is 60 by default as it is on the documentation

http://nagios.sourceforge.net/docs/3_0/ ... val_length
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Notification period

Post by slansing »

Are they actual host notifications, or are they from services under the hosts? They are different and must both have an interval defined. Did you try to define the interval as you showed above:
# notification_interval
If so you must remove the "#" in front of the line as that comments it out of the configuration.

As an example "from a nagios xi configuration":

Code: Select all

define host {
        host_name                       192.168.5.63
        use                             xiwizard_windowsserver_host
        address                         192.168.5.63
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        contacts                        nagiosadmin
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        icon_image                      win_server.png
        statusmap_image                 win_server.png
        _xiwizard                       windowsserver
        register                        1
        }
This host will send out notifications at a 60 second interval once a problem is detected. 60 is the value in seconds and would need to be changed to better suit your environment.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Notification period

Post by MPIvan »

Well about the question is it a host or service ... its both ... the thing is that i comment the notification_interval on all places (host and service) and some how he still send me re-notification about the status ... so somewhere is still get the notification_interval. I place notification_interval to be 0 at host and it is ok now ... now i would like to find where is write the notification_interval on other places to changed from source because somewhere he inherit the notification_interval number.

Also i would like to make some changes if it possible to do that ... if i get re-notification in 30 min, next re-notification to be in 60 min.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Notification period

Post by sreinhardt »

If this is not defined anywhere, I believe it is the default behavior for nagios to send every 30 minutes unless otherwise defined. Otherwise you can always do a grep -R "notification_interval" /usr/local/nagios/etc/ As for changing the interval between notifications, I believe you would want to look at notification escalations
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked