[Nagios-devel] problem with %ENV and macros in event handler

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
Guest

[Nagios-devel] problem with %ENV and macros in event handler

Post by Guest »

Hello All,
I'm writing an event handler in perl for nagios 2.6 and I can't seem to
be able to access the macros as exported to the environment by using %ENV.

I've enabled logging and I can see the script (env_output) being run as
in these two lines:
[1210710038] SERVICE ALERT: clone;SMTP;OK;HARD;3;SMTP OK - 0.148 sec.
response time
[1210710038] SERVICE EVENT HANDLER: clone;SMTP;OK;HARD;3;env_output

The script itself is very simple as it is only a debugging tool:

#!/usr/bin/perl -w
use use Data::Dumper;
use strict;

open(ENV,">","/var/log/nagios/env.dump");
print ENV Dumper(\%ENV);
close ENV;

[end of script]


Here is the output:
$VAR1 = {
'SHLVL' => '2',
'PWD' => '/',
'TERM' => 'xterm',
'_' => '/usr/sbin/nagios',
'LANG' => 'en_US',
'PATH' => '/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin'
};

So no NAGIOS_* => anything.

What am I missing?
Thank you for your help.

Louis






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked