Issue with contact macros in environment variables

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
uragusan
Posts: 12
Joined: Wed Jul 08, 2015 4:02 am

Issue with contact macros in environment variables

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Issue with contact macros in environment variables

Post 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.
uragusan
Posts: 12
Joined: Wed Jul 08, 2015 4:02 am

Re: Issue with contact macros in environment variables

Post 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.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Issue with contact macros in environment variables

Post 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).
uragusan
Posts: 12
Joined: Wed Jul 08, 2015 4:02 am

Re: Issue with contact macros in environment variables

Post by uragusan »

thank you very much, it's seems to work.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Issue with contact macros in environment variables

Post by hsmith »

uragusan wrote:thank you very much, it's seems to work.
Glad we could help.

Thank you.
Former Nagios Employee.
me.
Locked