[Check_mk (english)] email: custom notifications with PNP4nagios not working?

Andreas Döhler andreas.doehler at gmail.com
Wed Jul 27 22:04:18 CEST 2016


Hi Eric,

I would hard code the parameters for PNP according to your setup.
It would be more work to workaround the second problem :)

The line numbers are taken from the git status --
http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob;f=notifications/mail

The changes must be made around line 540. Variable "path" needs to be build
for your system. The environment with "REMOTE_USER" depends on your
installation.

As your rule sets the variable "url_prefix" the second parameter is ignored.
If you want to look, line 700 onward gives the explanation.

Best regards
Andreas

Eric Malenfant <eric.malenfant at cira.ca> schrieb am Mi., 27. Juli 2016 um
21:47 Uhr:

> First, this is check_mk (RAW) 1.2.8p5 on top of Nagios Core 4.1.1 (working
> fine) - not OMD.
>
> 2 separate problems have been observed:
>
> 1: without rule based notifications:
> I can configure each user to use HTML email, and define the 2 required
> plugin arguments, pnp4nagios location, and URL (PARAMETER_1 and _2)
> This works fine.. save that I also want to customize the Subject line, and
> what gets sent.
> So, I have a rule defined for that.
>
> notification_parameters.setdefault('mail', [])
>
> notification_parameters['mail'] = [
>   ( {'reply_to': 'nagios at cira.ca', 'url_prefix': 'http://nagios/check_mk/',
> 'host_subject': u'$HOSTNAME$ - $EVENT_TXT$', 'service_subject':
> u'$HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$', 'elements': ['address', 'abstime',
> 'reltime', 'longoutpu
> t', 'ack_author', 'ack_comment', 'graph']}, [], ALL_HOSTS ),
> ] + notification_parameters['mail']
>
> This doesn't seem to get applied at all.
>
> Flip it around, for issue #2:
>
> I enabled rule base notifications, created 1 single rule - and now my
> notication_parameters work, but pnp4nagios graphs don't get attached, and
> complaints in notify.log;
>
> 2016-07-27 14:51:24 Preparing flexible notifications for emalenfant
> 2016-07-27 14:51:24  Notification channel with plugin mail
> 2016-07-27 14:51:24      executing /usr/share/check_mk/notifications/mail
> 2016-07-27 14:51:24      Output: Failed to add graphs to mail. Continue
> without them. ('OMD_ROOT')
>
> So now, notification_parameters does get applied correctly now, but no
> graphs, and no option to enter any plugin parameters.
>
> Any work-arounds/solutions at this time for either of these 2 issues?
> I'll take one or the other at this point.
>
> Eric Malenfant
> Sr Systems Administrator
>
> The Canadian Internet Registration Authority (CIRA)
> 979 Bank Street, Suite 400
> Ottawa, ON , K1S 5K5
> Tel:   (613) 237-5335 Ext:267
> Cel:   (613) 513-9314
> Fax:  (613) 237-0534
>
> e-mail: eric.malenfant at cira.ca
>
>
> _______________________________________________
> checkmk-en mailing list
> checkmk-en at lists.mathias-kettner.de
> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mathias-kettner.de/pipermail/checkmk-en/attachments/20160727/af4f0c7a/attachment-0001.html>


More information about the checkmk-en mailing list