[Check_mk (english)] flexible notification not working

Hello,

I’m setting up check_mk in a fresh install.

All seems to be working except for the notification.

When nagios send a notification I can see the following in the nagios.log:

[1404229651] EXTERNAL COMMAND: SEND_CUSTOM_SVC_NOTIFICATION;dittor47clxp012;Mount options of /var;0;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: gontero;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: 15104AA;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F02556B;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F14261A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F56945A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U106304;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U112994;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: luigi;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: u802730;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7555 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=gontero

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7557 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F02556B

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7556 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=15104AA

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

[1404229651] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=15104AA, …) failed. errno is 2: No such file or directory

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7562 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=u802730

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7577 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U112994

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7560 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F14261A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7558 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F56945A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7559 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U106304

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7563 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=luigi

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

In the nagios.debug I can see:

[1404230067.486924] [2048.1] [pid=7743] **** BEGIN MACRO PROCESSING ***********

  • [1404230067.486764] [064.1] [pid=7743] [1404230067.487040] [2048.1] [pid=7743] Processing: ‘NOTIFY_CONTACTNAME=’$CONTACTNAME$’ NOTIFY_CONTACTEMAIL=’$CONTACTEMAIL$’ NOTIFY_CONTACTPAGER=’$CONTACTPAGER$’ NOTIFY_NOTIFICATIONTYPE=’$NOTIFICATIONTYPE$’
    NOTIFY_HOSTNOTIFICATIONNUMBER=’$HOSTNOTIFICATIONNUMBER$’ NOTIFY_SERVICENOTIFICATIONNUMBER=’$SERVICENOTIFICATIONNUMBER$’ NOTIFY_HOSTPROBLEMID=’$HOSTPROBLEMID$’ NOTIFY_SERVICEPROBLEMID=’$SERVICEPROBLEMID$’ NOTIFY_HOSTNAME=’$HOSTNAME$’ NOTIFY_HOSTALIAS=’$HOSTALIAS$’
    NOTIFY_HOSTADDRESS=’$HOSTADDRESS$’ NOTIFY_LASTHOSTSTATE=’$LASTHOSTSTATE$’ NOTIFY_LASTHOSTSTATECHANGE=’$LASTHOSTSTATECHANGE$’ NOTIFY_HOSTSTATE=’$HOSTSTATE$’ NOTIFY_HOSTSTATEID=’$HOSTSTATEID$’ NOTIFY_HOSTCHECKCOMMAND=’$HOSTCHECKCOMMAND$’ NOTIFY_HOSTOUTPUT=’$HOSTOUTPUT$’
    NOTIFY_HOSTPERFDATA=’$HOSTPERFDATA$’ NOTIFY_LONGHOSTOUTPUT=’$LONGHOSTOUTPUT$’ NOTIFY_SERVICEDESC=’$SERVICEDESC$’ NOTIFY_LASTSERVICESTATE=’$LASTSERVICESTATE$’ NOTIFY_LASTSERVICESTATECHANGE=’$LASTSERVICESTATECHANGE$’ NOTIFY_SERVICESTATE=’$SERVICESTATE$’ NOTIFY_SERVICESTATEID=’$SERVICESTATEID$’
    NOTIFY_SERVICEOUTPUT=’$SERVICEOUTPUT$’ NOTIFY_LONGSERVICEOUTPUT=’$LONGSERVICEOUTPUT$’ NOTIFY_SERVICEPERFDATA=’$SERVICEPERFDATA$’ NOTIFY_SERVICECHECKCOMMAND=’$SERVICECHECKCOMMAND$’ NOTIFY_DATE=’$DATE$’ NOTIFY_SHORTDATETIME=’$SHORTDATETIME$’ NOTIFY_LONGDATETIME=’$LONGDATETIME$’
    NOTIFY_HOSTDOWNTIME=’$HOSTDOWNTIME$’ NOTIFY_NOTIFICATIONCOMMENT=’$NOTIFICATIONCOMMENT$’ NOTIFY_NOTIFICATIONAUTHOR=’$NOTIFICATIONAUTHOR$’ NOTIFY_NOTIFICATIONAUTHORNAME=’$NOTIFICATIONAUTHORNAME$’ NOTIFY_NOTIFICATIONAUTHORALIAS=’$NOTIFICATIONAUTHORALIAS$’ NOTIFY_HOSTTAGS=’$_HOSTTAGS$’
    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’*

[1404230067.487185] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_SL’!

[1404230067.487200] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487214] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487228] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_CONTACT’!

[1404230067.487242] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_CONTACT’!

  • [1404230067.487266] [2048.1] [pid=7743] Done. Final output: ‘NOTIFY_CONTACTNAME=‘u802730’ NOTIFY_CONTACTEMAIL=‘tino.italia@consultant.fiat.com’ NOTIFY_CONTACTPAGER=‘r’ NOTIFY_NOTIFICATIONTYPE=‘CUSTOM’ NOTIFY_HOSTNOTIFICATIONNUMBER=‘0’
    NOTIFY_SERVICENOTIFICATIONNUMBER=‘0’ NOTIFY_HOSTPROBLEMID=‘0’ NOTIFY_SERVICEPROBLEMID=‘0’ NOTIFY_HOSTNAME=‘dittor47clxp012’ NOTIFY_HOSTALIAS=‘dittor47clxp012’ NOTIFY_HOSTADDRESS=‘10.105.0.12’ NOTIFY_LASTHOSTSTATE=‘UP’ NOTIFY_LASTHOSTSTATECHANGE=‘1404140423’
    NOTIFY_HOSTSTATE=‘UP’ NOTIFY_HOSTSTATEID=‘0’ NOTIFY_HOSTCHECKCOMMAND=‘check-mk-host-ping’ NOTIFY_HOSTOUTPUT=‘OK - 10.105.0.12: rta 0.291ms, lost 0%’ NOTIFY_HOSTPERFDATA=‘rta=0.291ms;200.000;500.000;0; pl=0%;40;80;; rtmax=0.611ms;;;; rtmin=0.164ms;;;;’ NOTIFY_LONGHOSTOUTPUT=’’
    NOTIFY_SERVICEDESC=‘Mount options of /var’ NOTIFY_LASTSERVICESTATE=‘OK’ NOTIFY_LASTSERVICESTATECHANGE=‘1404140700’ NOTIFY_SERVICESTATE=‘OK’ NOTIFY_SERVICESTATEID=‘0’ NOTIFY_SERVICEOUTPUT=‘OK - mount options exactly as expected’ NOTIFY_LONGSERVICEOUTPUT=’’
    NOTIFY_SERVICEPERFDATA=’’ NOTIFY_SERVICECHECKCOMMAND=‘check_mk-mounts’ NOTIFY_DATE=‘07-01-2014’ NOTIFY_SHORTDATETIME=‘07-01-2014 17:54:27’ NOTIFY_LONGDATETIME=‘Tue Jul 1 17:54:27 CEST 2014’ NOTIFY_HOSTDOWNTIME=‘0’ NOTIFY_NOTIFICATIONCOMMENT=‘TEST’ NOTIFY_NOTIFICATIONAUTHOR=‘F56945A’
    NOTIFY_NOTIFICATIONAUTHORNAME=’’ NOTIFY_NOTIFICATIONAUTHORALIAS=’’ NOTIFY_HOSTTAGS=‘cmk-agent prod lan tcp wato /wato/database/’ 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’*

[1404230067.487279] [2048.1] [pid=7743] **** END MACRO PROCESSING *************

The /usr/bin/check_mk exists, and the notification script located under /usr/share/check_mk/notifications/ work if launched manually.

I’ve debugged my script and I saw that nagios is not launching the notification script.

I’ve tried to insert notification_logging = 2 in the main.mk file but no notify.log was created.

There is a way to debug this situation?

Thanks

Lorenzo Mao

IT Specialist

Email:
lorenzo.mao@solve.it

image001.jpg

Solve.it S.r.l.

Lungo Dora Colletta, 81

10153 Torino, Italia

www.solve.it

Hi Lorenzo,

This is a known bug in Nagios 4.x.

http://tracker.nagios.org/view.php?id=582

My patch (582-command-v3.patch) attached to that bug is a quick and simple workaround.

The nagios devs have taken a different approach which also works, and will be merged into the master nagios 4 tree ‘soon’.

Cheers,

Phil

image001.jpg

···

From: checkmk-en-bounces@lists.mathias-kettner.de
[mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of Lorenzo Mao
Sent: 01 July 2014 17:00
To: checkmk-en@lists.mathias-kettner.de
Cc: Domenico Montanaro; Claudio Gabbani
Subject: [Check_mk (english)] flexible notification not working

Hello,

I’m setting up check_mk in a fresh install.

All seems to be working except for the notification.

When nagios send a notification I can see the following in the nagios.log:

[1404229651] EXTERNAL COMMAND: SEND_CUSTOM_SVC_NOTIFICATION;dittor47clxp012;Mount options of /var;0;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: gontero;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: 15104AA;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F02556B;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F14261A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F56945A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U106304;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U112994;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: luigi;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: u802730;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7555 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=gontero

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7557 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F02556B

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7556 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=15104AA

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

[1404229651] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=15104AA, …) failed. errno is 2: No such file or directory

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7562 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=u802730

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7577 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U112994

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7560 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F14261A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7558 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F56945A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7559 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U106304

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7563 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=luigi

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

In the nagios.debug I can see:

[1404230067.486924] [2048.1] [pid=7743] **** BEGIN MACRO PROCESSING ***********

  • [1404230067.486764] [064.1] [pid=7743] [1404230067.487040] [2048.1] [pid=7743] Processing: ‘NOTIFY_CONTACTNAME=’$CONTACTNAME$’ NOTIFY_CONTACTEMAIL=’$CONTACTEMAIL$’ NOTIFY_CONTACTPAGER=’$CONTACTPAGER$’ NOTIFY_NOTIFICATIONTYPE=’$NOTIFICATIONTYPE$’
    NOTIFY_HOSTNOTIFICATIONNUMBER=’$HOSTNOTIFICATIONNUMBER$’ NOTIFY_SERVICENOTIFICATIONNUMBER=’$SERVICENOTIFICATIONNUMBER$’ NOTIFY_HOSTPROBLEMID=’$HOSTPROBLEMID$’ NOTIFY_SERVICEPROBLEMID=’$SERVICEPROBLEMID$’ NOTIFY_HOSTNAME=’$HOSTNAME$’ NOTIFY_HOSTALIAS=’$HOSTALIAS$’
    NOTIFY_HOSTADDRESS=’$HOSTADDRESS$’ NOTIFY_LASTHOSTSTATE=’$LASTHOSTSTATE$’ NOTIFY_LASTHOSTSTATECHANGE=’$LASTHOSTSTATECHANGE$’ NOTIFY_HOSTSTATE=’$HOSTSTATE$’ NOTIFY_HOSTSTATEID=’$HOSTSTATEID$’ NOTIFY_HOSTCHECKCOMMAND=’$HOSTCHECKCOMMAND$’ NOTIFY_HOSTOUTPUT=’$HOSTOUTPUT$’
    NOTIFY_HOSTPERFDATA=’$HOSTPERFDATA$’ NOTIFY_LONGHOSTOUTPUT=’$LONGHOSTOUTPUT$’ NOTIFY_SERVICEDESC=’$SERVICEDESC$’ NOTIFY_LASTSERVICESTATE=’$LASTSERVICESTATE$’ NOTIFY_LASTSERVICESTATECHANGE=’$LASTSERVICESTATECHANGE$’ NOTIFY_SERVICESTATE=’$SERVICESTATE$’ NOTIFY_SERVICESTATEID=’$SERVICESTATEID$’
    NOTIFY_SERVICEOUTPUT=’$SERVICEOUTPUT$’ NOTIFY_LONGSERVICEOUTPUT=’$LONGSERVICEOUTPUT$’ NOTIFY_SERVICEPERFDATA=’$SERVICEPERFDATA$’ NOTIFY_SERVICECHECKCOMMAND=’$SERVICECHECKCOMMAND$’ NOTIFY_DATE=’$DATE$’ NOTIFY_SHORTDATETIME=’$SHORTDATETIME$’ NOTIFY_LONGDATETIME=’$LONGDATETIME$’
    NOTIFY_HOSTDOWNTIME=’$HOSTDOWNTIME$’ NOTIFY_NOTIFICATIONCOMMENT=’$NOTIFICATIONCOMMENT$’ NOTIFY_NOTIFICATIONAUTHOR=’$NOTIFICATIONAUTHOR$’ NOTIFY_NOTIFICATIONAUTHORNAME=’$NOTIFICATIONAUTHORNAME$’ NOTIFY_NOTIFICATIONAUTHORALIAS=’$NOTIFICATIONAUTHORALIAS$’ NOTIFY_HOSTTAGS=’$_HOSTTAGS$’
    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’*

[1404230067.487185] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_SL’!

[1404230067.487200] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487214] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487228] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_CONTACT’!

[1404230067.487242] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_CONTACT’!

  • [1404230067.487266] [2048.1] [pid=7743] Done. Final output: ‘NOTIFY_CONTACTNAME=‘u802730’ NOTIFY_CONTACTEMAIL=‘tino.italia@consultant.fiat.com’ NOTIFY_CONTACTPAGER=‘r’ NOTIFY_NOTIFICATIONTYPE=‘CUSTOM’ NOTIFY_HOSTNOTIFICATIONNUMBER=‘0’
    NOTIFY_SERVICENOTIFICATIONNUMBER=‘0’ NOTIFY_HOSTPROBLEMID=‘0’ NOTIFY_SERVICEPROBLEMID=‘0’ NOTIFY_HOSTNAME=‘dittor47clxp012’ NOTIFY_HOSTALIAS=‘dittor47clxp012’ NOTIFY_HOSTADDRESS=‘10.105.0.12’ NOTIFY_LASTHOSTSTATE=‘UP’ NOTIFY_LASTHOSTSTATECHANGE=‘1404140423’
    NOTIFY_HOSTSTATE=‘UP’ NOTIFY_HOSTSTATEID=‘0’ NOTIFY_HOSTCHECKCOMMAND=‘check-mk-host-ping’ NOTIFY_HOSTOUTPUT=‘OK - 10.105.0.12: rta 0.291ms, lost 0%’ NOTIFY_HOSTPERFDATA=‘rta=0.291ms;200.000;500.000;0; pl=0%;40;80;; rtmax=0.611ms;;;; rtmin=0.164ms;;;;’ NOTIFY_LONGHOSTOUTPUT=’’
    NOTIFY_SERVICEDESC=‘Mount options of /var’ NOTIFY_LASTSERVICESTATE=‘OK’ NOTIFY_LASTSERVICESTATECHANGE=‘1404140700’ NOTIFY_SERVICESTATE=‘OK’ NOTIFY_SERVICESTATEID=‘0’ NOTIFY_SERVICEOUTPUT=‘OK - mount options exactly as expected’ NOTIFY_LONGSERVICEOUTPUT=’’
    NOTIFY_SERVICEPERFDATA=’’ NOTIFY_SERVICECHECKCOMMAND=‘check_mk-mounts’ NOTIFY_DATE=‘07-01-2014’ NOTIFY_SHORTDATETIME=‘07-01-2014 17:54:27’ NOTIFY_LONGDATETIME=‘Tue Jul 1 17:54:27 CEST 2014’ NOTIFY_HOSTDOWNTIME=‘0’ NOTIFY_NOTIFICATIONCOMMENT=‘TEST’ NOTIFY_NOTIFICATIONAUTHOR=‘F56945A’
    NOTIFY_NOTIFICATIONAUTHORNAME=’’ NOTIFY_NOTIFICATIONAUTHORALIAS=’’ NOTIFY_HOSTTAGS=‘cmk-agent prod lan tcp wato /wato/database/’ 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’*

[1404230067.487279] [2048.1] [pid=7743] **** END MACRO PROCESSING *************

The /usr/bin/check_mk exists, and the notification script located under /usr/share/check_mk/notifications/ work if launched manually.

I’ve debugged my script and I saw that nagios is not launching the notification script.

I’ve tried to insert notification_logging = 2 in the main.mk file but no notify.log was created.

There is a way to debug this situation?

Thanks

Lorenzo Mao

IT Specialist

Email:
lorenzo.mao@solve.it

Solve.it S.r.l.

Lungo Dora Colletta, 81

10153 Torino, Italia

www.solve.it

Thank you so much.

That’s worked for me!

Great Job

image001.jpg

···

Lorenzo Mao

IT Specialist

Tel: +39 3404995109

Email:
lorenzo.mao@solve.it

Solve.it S.r.l.

Lungo Dora Colletta, 81

10153 Torino, Italia

www.solve.it

Da: Randal, Phil [mailto:phil.randal@hoopleltd.co.uk]
Inviato: martedì 1 luglio 2014 18:15
A: Lorenzo Mao; checkmk-en@lists.mathias-kettner.de
Oggetto: RE: flexible notification not working

Hi Lorenzo,

This is a known bug in Nagios 4.x.

http://tracker.nagios.org/view.php?id=582

My patch (582-command-v3.patch) attached to that bug is a quick and simple workaround.

The nagios devs have taken a different approach which also works, and will be merged into the master nagios 4 tree ‘soon’.

Cheers,

Phil

From:
checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of Lorenzo Mao
Sent: 01 July 2014 17:00
To: checkmk-en@lists.mathias-kettner.de
Cc: Domenico Montanaro; Claudio Gabbani
Subject: [Check_mk (english)] flexible notification not working

Hello,

I’m setting up check_mk in a fresh install.

All seems to be working except for the notification.

When nagios send a notification I can see the following in the nagios.log:

[1404229651] EXTERNAL COMMAND: SEND_CUSTOM_SVC_NOTIFICATION;dittor47clxp012;Mount options of /var;0;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: gontero;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: 15104AA;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F02556B;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F14261A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: F56945A;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U106304;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: U112994;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: luigi;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] SERVICE NOTIFICATION: u802730;dittor47clxp012;Mount options of /var;CUSTOM (OK);check-mk-notify;OK - mount options exactly as expected;F56945A;TEST

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7555 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=gontero

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7557 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F02556B

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7556 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=15104AA

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

[1404229651] wproc: stderr line 01: execvp(NOTIFY_CONTACTNAME=15104AA, …) failed. errno is 2: No such file or directory

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7562 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=u802730

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7577 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U112994

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7560 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F14261A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7558 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=F56945A

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7559 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=U106304

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

[1404229651] wproc: NOTIFY job 1 from worker Core Worker 7563 is a non-check helper but exited with return code 2

[1404229651] wproc: host=dittor47clxp012; service=Mount options of /var; contact=luigi

[1404229651] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;

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

In the nagios.debug I can see:

[1404230067.486924] [2048.1] [pid=7743] **** BEGIN MACRO PROCESSING ***********

  • [1404230067.486764] [064.1] [pid=7743] [1404230067.487040] [2048.1] [pid=7743] Processing: ‘NOTIFY_CONTACTNAME=’$CONTACTNAME$’ NOTIFY_CONTACTEMAIL=’$CONTACTEMAIL$’ NOTIFY_CONTACTPAGER=’$CONTACTPAGER$’ NOTIFY_NOTIFICATIONTYPE=’$NOTIFICATIONTYPE$’
    NOTIFY_HOSTNOTIFICATIONNUMBER=’$HOSTNOTIFICATIONNUMBER$’ NOTIFY_SERVICENOTIFICATIONNUMBER=’$SERVICENOTIFICATIONNUMBER$’ NOTIFY_HOSTPROBLEMID=’$HOSTPROBLEMID$’ NOTIFY_SERVICEPROBLEMID=’$SERVICEPROBLEMID$’ NOTIFY_HOSTNAME=’$HOSTNAME$’ NOTIFY_HOSTALIAS=’$HOSTALIAS$’
    NOTIFY_HOSTADDRESS=’$HOSTADDRESS$’ NOTIFY_LASTHOSTSTATE=’$LASTHOSTSTATE$’ NOTIFY_LASTHOSTSTATECHANGE=’$LASTHOSTSTATECHANGE$’ NOTIFY_HOSTSTATE=’$HOSTSTATE$’ NOTIFY_HOSTSTATEID=’$HOSTSTATEID$’ NOTIFY_HOSTCHECKCOMMAND=’$HOSTCHECKCOMMAND$’ NOTIFY_HOSTOUTPUT=’$HOSTOUTPUT$’
    NOTIFY_HOSTPERFDATA=’$HOSTPERFDATA$’ NOTIFY_LONGHOSTOUTPUT=’$LONGHOSTOUTPUT$’ NOTIFY_SERVICEDESC=’$SERVICEDESC$’ NOTIFY_LASTSERVICESTATE=’$LASTSERVICESTATE$’ NOTIFY_LASTSERVICESTATECHANGE=’$LASTSERVICESTATECHANGE$’ NOTIFY_SERVICESTATE=’$SERVICESTATE$’ NOTIFY_SERVICESTATEID=’$SERVICESTATEID$’
    NOTIFY_SERVICEOUTPUT=’$SERVICEOUTPUT$’ NOTIFY_LONGSERVICEOUTPUT=’$LONGSERVICEOUTPUT$’ NOTIFY_SERVICEPERFDATA=’$SERVICEPERFDATA$’ NOTIFY_SERVICECHECKCOMMAND=’$SERVICECHECKCOMMAND$’ NOTIFY_DATE=’$DATE$’ NOTIFY_SHORTDATETIME=’$SHORTDATETIME$’ NOTIFY_LONGDATETIME=’$LONGDATETIME$’
    NOTIFY_HOSTDOWNTIME=’$HOSTDOWNTIME$’ NOTIFY_NOTIFICATIONCOMMENT=’$NOTIFICATIONCOMMENT$’ NOTIFY_NOTIFICATIONAUTHOR=’$NOTIFICATIONAUTHOR$’ NOTIFY_NOTIFICATIONAUTHORNAME=’$NOTIFICATIONAUTHORNAME$’ NOTIFY_NOTIFICATIONAUTHORALIAS=’$NOTIFICATIONAUTHORALIAS$’ NOTIFY_HOSTTAGS=’$_HOSTTAGS$’
    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’*

[1404230067.487185] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_SL’!

[1404230067.487200] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487214] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_SL’!

[1404230067.487228] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_HOSTEC_CONTACT’!

[1404230067.487242] [2048.0] [pid=7743] WARNING: An error occurred processing macro ‘_SERVICEEC_CONTACT’!

  • [1404230067.487266] [2048.1] [pid=7743] Done. Final output: ‘NOTIFY_CONTACTNAME=‘u802730’ NOTIFY_CONTACTEMAIL=‘tino.italia@consultant.fiat.com’ NOTIFY_CONTACTPAGER=‘r’ NOTIFY_NOTIFICATIONTYPE=‘CUSTOM’ NOTIFY_HOSTNOTIFICATIONNUMBER=‘0’
    NOTIFY_SERVICENOTIFICATIONNUMBER=‘0’ NOTIFY_HOSTPROBLEMID=‘0’ NOTIFY_SERVICEPROBLEMID=‘0’ NOTIFY_HOSTNAME=‘dittor47clxp012’ NOTIFY_HOSTALIAS=‘dittor47clxp012’ NOTIFY_HOSTADDRESS=‘10.105.0.12’ NOTIFY_LASTHOSTSTATE=‘UP’ NOTIFY_LASTHOSTSTATECHANGE=‘1404140423’
    NOTIFY_HOSTSTATE=‘UP’ NOTIFY_HOSTSTATEID=‘0’ NOTIFY_HOSTCHECKCOMMAND=‘check-mk-host-ping’ NOTIFY_HOSTOUTPUT=‘OK - 10.105.0.12: rta 0.291ms, lost 0%’ NOTIFY_HOSTPERFDATA=‘rta=0.291ms;200.000;500.000;0; pl=0%;40;80;; rtmax=0.611ms;;;; rtmin=0.164ms;;;;’ NOTIFY_LONGHOSTOUTPUT=’’
    NOTIFY_SERVICEDESC=‘Mount options of /var’ NOTIFY_LASTSERVICESTATE=‘OK’ NOTIFY_LASTSERVICESTATECHANGE=‘1404140700’ NOTIFY_SERVICESTATE=‘OK’ NOTIFY_SERVICESTATEID=‘0’ NOTIFY_SERVICEOUTPUT=‘OK - mount options exactly as expected’ NOTIFY_LONGSERVICEOUTPUT=’’
    NOTIFY_SERVICEPERFDATA=’’ NOTIFY_SERVICECHECKCOMMAND=‘check_mk-mounts’ NOTIFY_DATE=‘07-01-2014’ NOTIFY_SHORTDATETIME=‘07-01-2014 17:54:27’ NOTIFY_LONGDATETIME=‘Tue Jul 1 17:54:27 CEST 2014’ NOTIFY_HOSTDOWNTIME=‘0’ NOTIFY_NOTIFICATIONCOMMENT=‘TEST’ NOTIFY_NOTIFICATIONAUTHOR=‘F56945A’
    NOTIFY_NOTIFICATIONAUTHORNAME=’’ NOTIFY_NOTIFICATIONAUTHORALIAS=’’ NOTIFY_HOSTTAGS=‘cmk-agent prod lan tcp wato /wato/database/’ 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’*

[1404230067.487279] [2048.1] [pid=7743] **** END MACRO PROCESSING *************

The /usr/bin/check_mk exists, and the notification script located under /usr/share/check_mk/notifications/ work if launched manually.

I’ve debugged my script and I saw that nagios is not launching the notification script.

I’ve tried to insert notification_logging = 2 in the main.mk file but no notify.log was created.

There is a way to debug this situation?

Thanks

Lorenzo Mao

IT Specialist

Email:
lorenzo.mao@solve.it

Solve.it S.r.l.

Lungo Dora Colletta, 81

10153 Torino, Italia

www.solve.it

Hoople Ltd, Registered in England and Wales No. 7556595

Registered office: Plough Lane, Hereford, HR4 0LE

“Any opinion expressed in this e-mail or any attached files are those of the individual and not necessarily those of Hoople Ltd. You should
be aware that Hoople Ltd. monitors its email service. This e-mail and any attached files are confidential and intended solely for the use of the addressee. This communication may contain material protected by law from being passed on. If you are not the intended
recipient and have received this e-mail in error, you are advised that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please contact the sender immediately and destroy
all copies of it.”