Page 1 of 1

Email notification alert question

Posted: Thu Aug 11, 2016 9:11 am
by hoffman2503
Hi Nagios support team,

How are you doing? Hope things are well.

I'm in a middle of setting up an email notification alert for a very specific service from a host, but I have no idea how it's done, most of the alert notification I see is for the alerts triggers from the entire host.

Can you show me step by step on a what configuration I need to set in order to send the following service notification to an email for every hour? Is there anyway I can control the Nagios to change the Warning state to Critical state if the alert doesn't go off after an hour? If not is there a way I can just send the email notification after an hour if the alert doesn't go off? Your response is very appreciated!

define service{
use generic-service
host_name abc
service_description Printer queue - abcprinter
check_command check_nrpe!check_printer_queue -H 10.44.22.14 -c CheckCounter -a 'Counter=\Print Queue(abcprinter)\Jobs' MaxWarn=1 MaxCrit=2 ShowAll
}


# Contact for receiving alerts
define contact{
use generic-contact
contact_name hoffman2503
alias hoffman2503
email [email protected]
}


Thanks!
Tuck

Re: Email notification alert question

Posted: Thu Aug 11, 2016 9:50 am
by hoffman2503
I tried to add the following entries on Templates.cfg but still not receiving email and text:

#abc printer queue test
define service{
# use generic-service
host_name abc01
service_description Printer queue - abcPrinter1
check_command check_nrpe!check_printer_queue -H 1.1.1.1.1 --c CheckCounter -a 'Counter=\Print Queue(abcPrinter1)\Jobs' MaxWarn=1 MaxCrit=1 ShowAll
normal_check_interval 1 ; Check the service every 1 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
max_check_attempts 1
check_period 24x7
notification_period 24x7
notifications_enabled 1
notification_interval 1
contact_groups abc_printer_queue
}


Anything wrong here?

Re: Email notification alert question

Posted: Thu Aug 11, 2016 3:56 pm
by lmiltchev
Is "hoffman2503" contact member of "abc_printer_queue" contactgroup? Have you tried sending a test email from the command line to see if you are going to receive it? Do you see any clues in the mail log?

Re: Email notification alert question

Posted: Mon Aug 15, 2016 5:58 am
by hoffman2503
Yes. It's the contact group, the test email has been received successfully when i use sendmail.

Re: Email notification alert question

Posted: Mon Aug 15, 2016 12:59 pm
by rkennedy
Just to clarify, are you using the abc01 or abc host?

Code: Select all

define service{
use generic-service
host_name abc
service_description Printer queue - abcprinter
check_command check_nrpe!check_printer_queue -H 10.44.22.14 -c CheckCounter -a 'Counter=\Print Queue(abcprinter)\Jobs' MaxWarn=1 MaxCrit=2 ShowAll
}
is completely different then -

Code: Select all

#abc printer queue test
define service{
# use generic-service
host_name abc01
service_description Printer queue - abcPrinter1
check_command check_nrpe!check_printer_queue -H 1.1.1.1.1 --c CheckCounter -a 'Counter=\Print Queue(abcPrinter1)\Jobs' MaxWarn=1 MaxCrit=1 ShowAll
normal_check_interval 1 ; Check the service every 1 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
max_check_attempts 1
check_period 24x7
notification_period 24x7
notifications_enabled 1
notification_interval 1
contact_groups abc_printer_queue
}
Can you post your /usr/local/nagios/var/objects.cache file for us to look at? This will have the full compiled definition for us to look at, which should help immensely.