Time of Email Notifications
Time of Email Notifications
I am using Nagios Core v3
in my objects folder, I have a hosts.cfg file containing a list of IP/hosts I am just monitoring ping to see up/down state.
I am using postfix, and email notifications work great.
The problem is, Nagios is only sending out email notifications between 9am - 5pm daily, and none on weekends.
Where do I find and set this to send alerts 24x7
Thanks!
in my objects folder, I have a hosts.cfg file containing a list of IP/hosts I am just monitoring ping to see up/down state.
I am using postfix, and email notifications work great.
The problem is, Nagios is only sending out email notifications between 9am - 5pm daily, and none on weekends.
Where do I find and set this to send alerts 24x7
Thanks!
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Time of Email Notifications
You would have another config for the contact that is receiving the messages, assigned to that is a timeperiod for the host_notification_period and service_notification_period.
This timeperiod is another configuration that has days and times in it. Once modified you would need to restart the nagios service for the changes to take affect
This timeperiod is another configuration that has days and times in it. Once modified you would need to restart the nagios service for the changes to take affect
Re: Time of Email Notifications
This is my current contacts.cfg ---
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias FINY ALERT ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email,notify-service-by-sms
host_notification_commands notify-host-by-email,notify-host-by-sms
email me@myemail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
pager +15555555555 ; <<***** CHANGE THIS TO YOUR PHONE NUMBER ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias FINY ALERT ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email,notify-service-by-sms
host_notification_commands notify-host-by-email,notify-host-by-sms
email me@myemail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
pager +15555555555 ; <<***** CHANGE THIS TO YOUR PHONE NUMBER ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Time of Email Notifications
so this is the timeperiods specified
now you need to find the timeperiod definition for 24x7
Code: Select all
service_notification_period 24x7
host_notification_period 24x7
Re: Time of Email Notifications
would this need to be specified in my hosts.cfg file for each individual host?
Re: Time of Email Notifications
my hosts.cfg file is a long list like this..
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name WiFi-AP-HR
alias WiFi-AP-HR
address 192.168.1.7
}
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name WiFi-AP-Training
alias WiFi-AP-Training
address 192.168.1.6
}
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name WiFi-AP-HR
alias WiFi-AP-HR
address 192.168.1.7
}
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name WiFi-AP-Training
alias WiFi-AP-Training
address 192.168.1.6
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Time of Email Notifications
No, these are contact definitions
https://assets.nagios.com/downloads/nag ... ml#contact
Did you fine the timeperiod definition for 24x7?
This is what they look like but the timeperiod_name would be 24x7
https://assets.nagios.com/downloads/nag ... timeperiod
https://assets.nagios.com/downloads/nag ... ml#contact
Did you fine the timeperiod definition for 24x7?
This is what they look like but the timeperiod_name would be 24x7
https://assets.nagios.com/downloads/nag ... timeperiod
Re: Time of Email Notifications
contacts.cfg
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias FINY ALERT ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email,notify-service-by-sms
host_notification_commands notify-host-by-email,notify-host-by-sms
email tim@tcnets.com,service@tcnets.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
pager +17168706854 ; <<***** CHANGE THIS TO YOUR PHONE NUMBER ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias FINY ALERT ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email,notify-service-by-sms
host_notification_commands notify-host-by-email,notify-host-by-sms
email tim@tcnets.com,service@tcnets.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
pager +17168706854 ; <<***** CHANGE THIS TO YOUR PHONE NUMBER ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
Re: Time of Email Notifications
timeperiods.cfg
define timeperiod{
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
# 'workhours' timeperiod definition
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 09:00-17:00
}
define timeperiod{
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
# 'workhours' timeperiod definition
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 09:00-17:00
tuesday 09:00-17:00
wednesday 09:00-17:00
thursday 09:00-17:00
friday 09:00-17:00
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Time of Email Notifications
Are you sure YOUR contact isn't set to use workhours because that looks like 9-5
Are you the nagiosadmin contact only, or is that your only contact?
Are you the nagiosadmin contact only, or is that your only contact?