[smokeping-users] Re: smokeping quits ?
Tobias Oetiker
oetiker at ee.ethz.ch
Sat Feb 12 10:53:04 MET 2005
Hi Peter,
it seems that
my $smtp = Net::SMTP->new($cfg->{General}{mailhost}
is not succesful for your system ... you can alter the code like
this to get a warning and not a kill
sub sendmail ($$$){
my $from = shift;
my $to = shift;
$to = $1 if $to =~ /<(.*?)>/;
my $body = shift;
if ($cfg->{General}{mailhost} and
my $smtp = Net::SMTP->new($cfg->{General}{mailhost});
$smtp->mail($from);
$smtp->to(split(/\s*,\s*/, $to));
$smtp->data();
$smtp->datasend($body);
$smtp->dataend();
$smtp->quit;
} elsif ($cfg->{General}{sendmail} or -x "/usr/lib/sendmail"){
open (M, "|-") || exec (($cfg->{General}{sendmail} || "/usr/lib/sendmail"),"-f",$from,$to);
print M $body;
close M;
} else {
warn "ERROR: not sending mail to $to, as all methodes failed\n";
}
}
cheers
tobi
> Hello smokeping-users,
>
> My smokeping quits after following message in /var/log/messages
>
> Feb 10 01:34:01 THOR smokeping[7899]: Alert bigloss triggered for World.Europe.Servers.Co-locateS
> Feb 10 01:34:41 THOR smokeping[7899]: Can't call method "mail" on an undefined value at /root/smokeping/lib/Smokeping.pm line 144.
>
> What can i do to prevent this ?
>
>
> Alvast bedankt,
> Peter Mees
>
>
> mailto:peter at cts.be
> CTS bvba
> Molsesteenweg 83
> 2490 BALEN
>
> -----------------------------------------------------
> This email and any attached files are confidential and may be legally
> privileged.
> If you are not the intended recipient, any disclosure, reproduction,
> copying, distribution, or other dissemination or use of this communication
> is strictly prohibited.
> If you have received this transmission in error please notify the sender
> immediately and then delete this email.
> Email transmission cannot be guaranteed to be secure or error free as
> information could be intercepted, corrupted, lost, destroyed, arrive late or
> incomplete, or contain viruses.
> The sender therefore is in no way liable for any errors or omissions in the
> content of this message, which may arise as a result of email transmission.
> If verification is required, please request a hard copy.
>
> --
> Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
> Archive http://www.ee.ethz.ch/~slist/smokeping-users
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
>
--
______ __ _
/_ __/_ / / (_) Oetiker @ ISG.EE, ETL F24.2, ETH, CH-8092 Zurich
/ // _ \/ _ \/ / System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/ http://people.ee.ethz.ch/oetiker +41(0)44-632-5286
--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the smokeping-users
mailing list