[Nagiosplug-help] Bitten by ePN?
Ralph.Grothe at itdz-berlin.de
Ralph.Grothe at itdz-berlin.de
Wed Nov 21 18:56:15 CET 2007
Hello List Subscribers,
I have written a custom SMS notification "plugin" in Perl
which isn't working as expected.
Whenever I run it as user nagios from the Nagios server in an
interactive shell
SMS messages are sent to my mobile.
Whereas when having the plugin executed by the nagios daemon (or
rather one of its child procs)
no SMS keeps coming in.
This could well be an issue with our SMS gateway relay.
So, I asked the admin of this relay to check his logs to tell me
what went wrong.
But he says all he can see is messages saying that the sender's
address hadn't been matched in the
allowed users' database, which isn't all that helpful.
I found out that in my plugin I need to "spoof" the SMTP "MAIL
FROM" value in the envelope
to something this SMS GW would accept.
As I am using Mail::Mailer I found that this can be achieved by
setting the environment MAILDOMAIN
appropiately.
So I am doing something similar to
my $sender = 'someone@'.$ENV{MAILDOMAIN};
Also, instead of passing in Nagios Macros as parameters I fetch
them from the environment
similar to e.g.
my @rcpts = ($ENV{NAGIOS_CONTACTEMAIL}) ||
qw(someone at fallback.domain);
I now wonder if I am possibly bitten by embedded Perl Nagios
here?
Cheers
Ralph
More information about the Help
mailing list