Nagios Core 4.0.2 Email notification

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
Tiorl
Posts: 2
Joined: Wed Feb 12, 2014 7:02 am

Nagios Core 4.0.2 Email notification

Post by Tiorl »

Hello,

I just setup nagios core 4.0.2 (CentOs 6.5) + check_mk, and I don't receive any email messages about alerts. In nagios.log I found following entry

Code: Select all

EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;DC-NAGIOS2;0;Nagios Admin;125689
[o1392202959] HOST NOTIFICATION: PavlovP;DC-NAGIOS2;CUSTOM (UP);check-mk-notify;OK - 172.16.0.26: rta 0.380ms, lost 0%;Nagios Admin;125689
[1392202959] wproc: NOTIFY job 850 from worker Core Worker 4839 is a non-check helper but exited with return code 2
[1392202959] wproc:   command: NOTIFY_CONTACTNAME='PavlovP' NOTIFY_CONTACTEMAIL='[email protected]' NOTIFY_CONTACTPAGER='r' NOTIFY_NOTIFICATIONTYPE='CUSTOM' NOTIFY_HOSTNOTIFICATIONNUMBER='0' 
NOTIFY_SERVICENOTIFICATIONNUMBER='$SERVICENOTIFICATIONNUMBER$' NOTIFY_HOSTPROBLEMID='0' NOTIFY_SERVICEPROBLEMID='$SERVICEPROBLEMID$' NOTIFY_HOSTNAME='DC-NAGIOS2' NOTIFY_HOSTALIAS='DC-NAGIOS2' 
NOTIFY_HOSTADDRESS='172.16.0.26' NOTIFY_LASTHOSTSTATE='UP' NOTIFY_LASTHOSTSTATECHANGE='1391867182' NOTIFY_LASTHOSTUP='1392202937' NOTIFY_HOSTSTATE='UP' NOTIFY_HOSTSTATEID='0' 
NOTIFY_HOSTCHECKCOMMAND='check-mk-host-ping' NOTIFY_HOSTOUTPUT='OK - 172.16.0.26: rta 0.380ms, lost 0%' NOTIFY_HOSTPERFDATA='rta=0.380ms;200.000;500.000;0; pl=0%;40;80;; rtmax=0.566ms;;;; rtmin=0.215ms;;;;
' NOTIFY_LONGHOSTOUTPUT='' NOTIFY_SERVICEDESC='$SERVICEDESC$' NOTIFY_LASTSERVICESTATE='$LASTSERVICESTATE$' NOTIFY_LASTSERVICESTATECHANGE='$LASTSERVICESTATECHANGE$' NOTIFY_LASTSERVICEOK='$LASTSERVICEOK$' 
NOTIFY_SERVICESTATE='$SERVICESTATE$' NOTIFY_SERVICESTATEID='$SERVICESTATEID$' NOTIFY_SERVICEOUTPUT='$SERVICEOUTPUT$' NOTIFY_LONGSERVICEOUTPUT='$LONGSERVICEOUTPUT$' NOTIFY_SERVICEPERFDATA='$SERVICEPERFDATA$' 
NOTIFY_SERVICECHECKCOMMAND='$SERVICECHECKCOMMAND$' NOTIFY_DATE='02-12-2014' NOTIFY_SHORTDATETIME='02-12-2014 15:02:39' NOTIFY_LONGDATETIME='Wed Feb 12 15:02:39 MSK 2014' NOTIFY_HOSTDOWNTIME='0' 
NOTIFY_NOTIFICATIONCOMMENT='125689' NOTIFY_NOTIFICATIONAUTHOR='Nagios Admin' NOTIFY_NOTIFICATIONAUTHORNAME='' NOTIFY_NOTIFICATIONAUTHORALIAS='' 
NOTIFY_HOSTTAGS='lan prod tcp HG_empty Check_MK NCG_NAgiosAdmin wato /wato/temp/' NOTIFY_HOST_SL='$_HOSTEC_SL$' NOTIFY_SVC_SL='$_SERVICEEC_SL$'
 NOTIFY_SERVICE_SL='$_SERVICEEC_SL$' NOTIFY_HOST_EC_CONTACT='$_HOSTEC_CONTACT$' NOTIFY_SERVICE_EC_CONTACT='$_SERVICEEC_CONTACT$' /usr/bin/check_mk --notify
[1392202959] wproc:   host=DC-NAGIOS2; service=(none); contact=PavlovP
[1392202959] wproc:   early_timeout=0; exited_ok=1; wait_status=512; error_code=0;
[1392202959] wproc:   stderr line 01: execvp(NOTIFY_CONTACTNAME=PavlovP, ...) failed. errno is 2: No such file or directory
Any suggestions?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Core 4.0.2 Email notification

Post by slansing »

You should be checking the mail log as well, try to cause an alert to be sent out, or send a custom notification from one of your objects that should be alerting via a contact, then show the output of the following:

Code: Select all

tail -25 /var/log/maillog
Tiorl
Posts: 2
Joined: Wed Feb 12, 2014 7:02 am

Re: Nagios Core 4.0.2 Email notification

Post by Tiorl »

slansing wrote:You should be checking the mail log as well, try to cause an alert to be sent out, or send a custom notification from one of your objects that should be alerting via a contact, then show the output of the following:

Code: Select all

tail -25 /var/log/maillog
Nothing in log, just old yesterday entrys, when i send emails from shell testing postfix.

Code: Select all

Feb 11 17:27:19 nagios postfix/smtp[25051]: CC17F60E92: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.26, delays=0.02/0.01/0/0.23, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2280822] Queued mail for delivery)
Feb 11 17:27:19 nagios postfix/qmgr[24903]: CC17F60E92: removed
Feb 11 17:32:14 nagios postfix/qmgr[24903]: AC04360E8E: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 17:32:14 nagios postfix/smtp[35880]: AC04360E8E: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=503, delays=503/0.01/0/0.27, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2280846] Queued mail for delivery)
Feb 11 17:32:14 nagios postfix/qmgr[24903]: AC04360E8E: removed
Feb 11 21:43:02 nagios postfix/pickup[16063]: B531560E95: uid=0 from=<root>
Feb 11 21:43:02 nagios postfix/cleanup[19507]: B531560E95: message-id=<[email protected]>
Feb 11 21:43:02 nagios postfix/qmgr[24903]: B531560E95: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 21:43:03 nagios postfix/smtp[19509]: B531560E95: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.44, delays=0.02/0.01/0/0.41, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2281168] Queued mail for delivery)
Feb 11 21:43:03 nagios postfix/qmgr[24903]: B531560E95: removed
Feb 11 22:12:32 nagios postfix/sendmail[59810]: fatal: usage: sendmail [options]
Feb 11 22:47:56 nagios postfix/pickup[40334]: A8F8160E97: uid=0 from=<root>
Feb 11 22:47:56 nagios postfix/cleanup[57919]: A8F8160E97: message-id=<[email protected]>
Feb 11 22:47:56 nagios postfix/qmgr[24903]: A8F8160E97: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 22:47:57 nagios postfix/smtp[57921]: A8F8160E97: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.37, delays=0.06/0.01/0/0.3, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2281172] Queued mail for delivery)
Feb 11 22:47:57 nagios postfix/qmgr[24903]: A8F8160E97: removed
Feb 11 22:49:20 nagios postfix/postfix-script[62933]: stopping the Postfix mail system
Feb 11 22:49:20 nagios postfix/master[24900]: terminating on signal 15
Feb 11 22:49:20 nagios postfix/postfix-script[63024]: starting the Postfix mail system
Feb 11 22:49:20 nagios postfix/master[63025]: daemon started -- version 2.6.6, configuration /etc/postfix
Feb 12 14:10:27 nagios postfix/pickup[18457]: 93CBD60D97: uid=0 from=<root>
Feb 12 14:10:27 nagios postfix/cleanup[27089]: 93CBD60D97: message-id=<[email protected]>
Feb 12 14:10:27 nagios postfix/qmgr[63029]: 93CBD60D97: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 12 14:10:27 nagios postfix/smtp[27091]: 93CBD60D97: to=<[email protected]>, relay=172.16.0.25[172.16.0.25]:25, delay=0.39, delays=0.05/0.01/0.01/0.32, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=6426690] Queued mail for delivery)
Feb 12 14:10:27 nagios postfix/qmgr[63029]: 93CBD60D97: removed
[root@nagios conf.d]# tail -25 /var/log/maillog
Feb 11 17:27:19 nagios postfix/smtp[25051]: CC17F60E92: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.26, delays=0.02/0.01/0/0.23, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2280822] Queued mail for delivery)
Feb 11 17:27:19 nagios postfix/qmgr[24903]: CC17F60E92: removed
Feb 11 17:32:14 nagios postfix/qmgr[24903]: AC04360E8E: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 17:32:14 nagios postfix/smtp[35880]: AC04360E8E: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=503, delays=503/0.01/0/0.27, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2280846] Queued mail for delivery)
Feb 11 17:32:14 nagios postfix/qmgr[24903]: AC04360E8E: removed
Feb 11 21:43:02 nagios postfix/pickup[16063]: B531560E95: uid=0 from=<root>
Feb 11 21:43:02 nagios postfix/cleanup[19507]: B531560E95: message-id=<[email protected]>
Feb 11 21:43:02 nagios postfix/qmgr[24903]: B531560E95: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 21:43:03 nagios postfix/smtp[19509]: B531560E95: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.44, delays=0.02/0.01/0/0.41, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2281168] Queued mail for delivery)
Feb 11 21:43:03 nagios postfix/qmgr[24903]: B531560E95: removed
Feb 11 22:12:32 nagios postfix/sendmail[59810]: fatal: usage: sendmail [options]
Feb 11 22:47:56 nagios postfix/pickup[40334]: A8F8160E97: uid=0 from=<root>
Feb 11 22:47:56 nagios postfix/cleanup[57919]: A8F8160E97: message-id=<[email protected]>
Feb 11 22:47:56 nagios postfix/qmgr[24903]: A8F8160E97: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 11 22:47:57 nagios postfix/smtp[57921]: A8F8160E97: to=<[email protected]>, relay=172.16.0.28[172.16.0.28]:25, delay=0.37, delays=0.06/0.01/0/0.3, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=2281172] Queued mail for delivery)
Feb 11 22:47:57 nagios postfix/qmgr[24903]: A8F8160E97: removed
Feb 11 22:49:20 nagios postfix/postfix-script[62933]: stopping the Postfix mail system
Feb 11 22:49:20 nagios postfix/master[24900]: terminating on signal 15
Feb 11 22:49:20 nagios postfix/postfix-script[63024]: starting the Postfix mail system
Feb 11 22:49:20 nagios postfix/master[63025]: daemon started -- version 2.6.6, configuration /etc/postfix
Feb 12 14:10:27 nagios postfix/pickup[18457]: 93CBD60D97: uid=0 from=<root>
Feb 12 14:10:27 nagios postfix/cleanup[27089]: 93CBD60D97: message-id=<[email protected]>
Feb 12 14:10:27 nagios postfix/qmgr[63029]: 93CBD60D97: from=<[email protected]>, size=454, nrcpt=1 (queue active)
Feb 12 14:10:27 nagios postfix/smtp[27091]: 93CBD60D97: to=<[email protected]>, relay=172.16.0.25[172.16.0.25]:25, delay=0.39, delays=0.05/0.01/0.01/0.32, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=6426690] Queued mail for delivery)
Feb 12 14:10:27 nagios postfix/qmgr[63029]: 93CBD60D97: removed
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Core 4.0.2 Email notification

Post by abrist »

Tiorl wrote:NOTIFY_HOSTTAGS='lan prod tcp HG_empty Check_MK NCG_NAgiosAdmin wato /wato/temp/' NOTIFY_HOST_SL='$_HOSTEC_SL$' NOTIFY_SVC_SL='$_SERVICEEC_SL$'
NOTIFY_SERVICE_SL='$_SERVICEEC_SL$' NOTIFY_HOST_EC_CONTACT='$_HOSTEC_CONTACT$' NOTIFY_SERVICE_EC_CONTACT='$_SERVICEEC_CONTACT$' /usr/bin/check_mk --notify
[1392202959] wproc: host=DC-NAGIOS2; service=(none); contact=PavlovP
[1392202959] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;
[1392202959] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=PavlovP, ...) failed. errno is 2: No such file or directory
My concern is that this may be due to check_mk as it addon is performing the notification: /usr/bin/check_mk --notify
Too bad we cannot get more verbose with that last line:
[1392202959] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=PavlovP, ...) failed. errno is 2: No such file or directory
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.
foxbuild
Posts: 1
Joined: Mon Mar 17, 2014 10:05 am

Re: Nagios Core 4.0.2 Email notification

Post by foxbuild »

HeyI have the same problems like you.

[1392202959] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=PavlovP, ...) failed. errno is 2: No such file or directory

Have you fix this problem???
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Core 4.0.2 Email notification

Post by slansing »

@Foxbuild, please open your own thread and post all relevant information regarding your issue. Thank you.
prandal
Posts: 8
Joined: Mon Nov 19, 2012 5:23 am

Re: Nagios Core 4.0.2 Email notification

Post by prandal »

I discovered this one independently.

I've logged the bug here: http://tracker.nagios.org/view.php?id=582 and attached a patch "582-command-v2.patch" which fixes it for me to that bug report.

Cheers,

Phil
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 4.0.2 Email notification

Post by lmiltchev »

Thanks for posting the bug report! Can we lock this topic as resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked