Hi guys. I've read several threads on related subjects, but I'm embarrassed to say that I didn't really follow the config settings listed.
I've got a whole bunch of hosts defined, and a whole bunch of services defined per host, all of which are being monitored, and (currently, only bc I'm still in the system config stage of my deployment) all of the hosts are set for sending notifications when required.
--------------------
sample host def:
define host{
use linux-server ; Inherit default values from a template
host_name lmprodwa2.lmgroup.com ; The name we're giving to this server
alias lmprodwa2 ; A longer name for the server
address 192.168.115.70 ; IP address of the server
contact_groups oncall ; contact for alert notifications
}
--------------
service def:
define service{
use generic-service
host_name lmprodwa2.lmgroup.com
service_description CPU Load
check_command check_nrpe!check_load
}
----------------------------
host notification def (yes, I'm using sendmail on my ubuntu Nagios server):
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/sbin/sendmail -s "$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$
}
---------------
contact def:
define contact{
contact_name itoncall ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias IT Oncall ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
----------------------
contact group def:
define contactgroup{
contactgroup_name oncall
alias Nagios Administrators
members itoncall
}
So what I'd like to do is this:
setup one notification group to receive all system warning and critical alerts (including problem, recovery and acknowledged messages), for 24/7 notification period.
setup another notification group to receive ONLY critical alerts (including only problem and recovery messages), for 24/7 notification period.
setup a third notification group to receive all system warning and critical alerts (including problem, recovery and acknowledged messages), only for business hours (8-5pm)
so far, I have the first notification group working fine, but I can't decipher the notification options, variables and arguments sufficiently to setup the other two notification groups effectively.
any help on this would be greatly appreciated!!!
thanks in advance,
- Jeremy
customizing notifications
Re: customizing notifications
Hi Jeremy,
Under your contact definition you have the following:
This is what your generic-contact will probably look like;
The link below describes each of the options for a contact definition:
As for time periods, this is the one you would need I think for the third one:
Change as required.
Hopefully this can point you in the right direction, good luck!
Kind Regards,
Gary Shergill
Under your contact definition you have the following:
Code: Select all
use generic-contact ; Inherit default values from generic-contact template (defined above)Code: Select all
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}Simply create three contact templates and set the users to whichever they require.
As for time periods, this is the one you would need I think for the third one:
Code: Select all
define timeperiod{
name workhours
timeperiod_name workhours
alias 8-5 A Day, 5 Days A Week
monday 08:00-17:00
tuesday 08:00-17:00
wednesday 08:00-17:00
thursday 08:00-17:00
friday 08:00-17:00
}Hopefully this can point you in the right direction, good luck!
Kind Regards,
Gary Shergill
Re: customizing notifications
If you have any other issues, open a new thread OP, and reference this thread.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.