Email notification alert question

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
hoffman2503
Posts: 4
Joined: Thu Aug 11, 2016 8:57 am

Email notification alert question

Post 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
hoffman2503
Posts: 4
Joined: Thu Aug 11, 2016 8:57 am

Re: Email notification alert question

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Email notification alert question

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
hoffman2503
Posts: 4
Joined: Thu Aug 11, 2016 8:57 am

Re: Email notification alert question

Post by hoffman2503 »

Yes. It's the contact group, the test email has been received successfully when i use sendmail.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Email notification alert question

Post 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.
Former Nagios Employee
Locked