[Check_mk (english)] OMD check_mk Nagios Environment Variables

Hi,

I am trying to implement Frank4DD’s HTML notification (http://nagios.frank4dd.com/howto/manual/nagios_send_service_mail.htm) but it’s not working. I was able to implement on regular Nagios server but not in OMD. Regular printf notification works fine in OMD.

After troubleshooting I found this reference, as stated in the FAQ: http://mathias-kettner.de/checkmk_faq.html

Q: Since I’m using MK Livestatus Nagios sometimes stops to execute checks. What’s wrong here?

nagios.cfg

enable_environment_macros=0

If you are using those macros (e.g. in notification scripts), you have to rewrite them using arguments and normal macros, such as $HOSTADDRESS$

Looks like the problem is that the perl script is full of environment macros, i.e.:

my $o_notificationtype = $ENV{NAGIOS_NOTIFICATIONTYPE};
my $o_hostname = $ENV{NAGIOS_HOSTNAME};

When I try running the script manually with the test switch it works fine (the variables are pre-defined for testing inside the script).

I have a feeling I have to replace a lot of the definitions with something else.

Thanks, Rod

···

A: That is due to a non thread safe implemention of how Nagios sets environment macros. You need to disable them in nagios.cfg:


-----------------------------------------
Visit www.nyc.gov/hhc
CONFIDENTIALITY NOTICE: The information in this E-Mail may be confidential and may be legally privileged. It is intended solely for the addressee(s). If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on this e-mail, is prohibited and may be unlawful. If you have received this E-Mail message in error, notify the sender by reply E-Mail and delete the message.