Page 1 of 1

Issue with contact macros in environment variables

Posted: Tue Aug 11, 2015 3:03 am
by uragusan
Hello,
For our Nagios 4.0.8 email notification we use nagios_mail.php(Extended Nagios Notification Mail author Otto Berger) that require to enable environment macros.
We have a problem with CONTACTMAIL Macro which always contains same mail address.
Same bug has already been described.
https://tracker.nagios.org/view.php?id=575

Does anyone know how I can apply the patch?

Re: Issue with contact macros in environment variables

Posted: Tue Aug 11, 2015 7:32 am
by jdalrymple
Download your source:

Code: Select all

wget https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.0.8.tar.gz
Untar:

Code: Select all

tar -xzvf Nagios-4.0.8.tar.gz
CD into directory:

Code: Select all

cd nagioscore-nagios-4.0.8
Patch the file:

Code: Select all

patch < /path/to/your/file.patch
Recompile/Reinstall

https://assets.nagios.com/downloads/nag ... l#nagios3x

I'll see about getting this into 4.10 if it isn't already.

Re: Issue with contact macros in environment variables

Posted: Tue Aug 11, 2015 10:13 am
by uragusan
jdalrymple wrote:
Patch the file:

Code: Select all

patch < /path/to/your/file.patch
Hi jdalrymple,
Thanks for yout answer, but it dosn’t work for me.
No output, macros.c wasn’t changed.

Re: Issue with contact macros in environment variables

Posted: Tue Aug 11, 2015 10:40 am
by jdalrymple
Sorry, my bad. On the 4.0.8 source you'll have to explicitly define the path to the file:

Code: Select all

[jdalrymple@localhost nagioscore-nagios-4.0.8]$ patch common/macros.c < ~/patch
patching file common/macros.c
Hunk #1 succeeded at 3172 (offset -24 lines).
Hunk #2 succeeded at 3380 (offset -5 lines).

Re: Issue with contact macros in environment variables

Posted: Wed Aug 12, 2015 1:52 am
by uragusan
thank you very much, it's seems to work.

Re: Issue with contact macros in environment variables

Posted: Wed Aug 12, 2015 9:36 am
by hsmith
uragusan wrote:thank you very much, it's seems to work.
Glad we could help.

Thank you.