<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: ËÎÌå; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> I want to configure the mail alert. </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">Configuration is as follows:</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">1. </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">pkg install perl5 , </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">install </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">Authen::SASL </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">Modular</span></div>
<div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">outbound_adsl_j160:/usr/local/lib/perl5@[10:30] #perldoc perllocal <br>You have an old groff. Update to version 1.20.1 for good Unicode support.<br>If you don't upgrade, wide characters may come out oddly.<br><br> at /usr/local/lib/perl5/5.16/Pod/Perldoc.pm line 1346.<br>You have an old groff. Update to version 1.20.1 for good Unicode support.<br>If you don't upgrade, wide characters may come out oddly.<br><br> at /usr/local/lib/perl5/5.16/Pod/Perldoc.pm line 1346.<br>PERLLOCAL(1) User Contributed Perl Documentation PERLLOCAL(1)<br><br> ESC[1mWed Apr 5 11:37:57 2017: "Module" Authen::SASLESC[0m<br> <B7> "installed into: /usr/local/lib/perl5/site_perl/5.16"<br><br> <B7> "LINKTYPE: dynamic"<br><br> <B7> "VERSION: 2.16"<br><br> <B7> "EXE_FILES: "<br><br>perl v5.16.3 2017-04-05 PERLLOCAL(1)<br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">2. </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">Configuration </span><span style="background-color: window; font-size: 10.5pt; line-height: 1.5;">Smokeping.pm </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">outbound_adsl_j160:/usr/local/smokeping/lib@[16:32] #more Smokeping.pm <br></span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br>use Authen::SASL; </span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">#</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">This line </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">increase </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br>sub sendmail ($$$){<br> my $from = shift;<br> my $to = shift;<br> $to = $1 if $to =~ /<(.*?)>/;<br> my $body = shift;<br> if ($cfg->{General}{mailhost} and <br> my $smtp = Net::SMTP->new([split /\s*,\s*/, $cfg->{General}{mailhost}],Timeout=>5) ){ <br> $smtp->auth(split(/\s*,\s*/, $cfg->{General}{mailusr}),split(/\s*,\s*/, $cfg->{General}{mailpwd})); </span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">#</span><span style="color: rgb(0, 0, 0); font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">This line </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">increase </span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br> $smtp->mail($from);<br> $smtp->to(split(/\s*,\s*/, $to));<br> $smtp->data();<br> $smtp->datasend($body);<br> $smtp->dataend();<br> $smtp->quit;<br> } elsif ($cfg->{General}{sendmail} or -x "/usr/lib/sendmail"){<br> open (M, "|-") || exec (($cfg->{General}{sendmail} || "/usr/lib/sendmail"),"-f",$from,$to);<br> print M $body;<br> close M;<br> } else {<br> warn "ERROR: not sending mail to $to, as all methodes failed\n";<br> }<br>}<br><br>#</span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">find</span><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> '_vars =>' , </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">increase</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"> mailusr mailpwd </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">DOC<br> _vars =><br> [ qw(owner imgcache imgurl datadir dyndir pagedir piddir sendmail offset<br> smokemail cgiurl mailhost mailusr mailpwd snpphost contact display_name<br> syslogfacility syslogpriority concurrentprobes changeprocessnames tmail<br> changecgiprogramname linkstyle precreateperms ) ],</span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">3. </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">Configuration </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">General </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">Alerts </span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">outbound_adsl_j160:/usr/local/etc/smokeping/conf.d@[16:37] #more General <br>*** General ***<br><br>owner = Peter Random<br>contact = some@address.nowhere<br>#mailhost = my.mail.host<br>mailhost = smtp.qq.com<br>mailusr = 514906434@qq.com<br>mailpwd = ZDHT#cetc2016<br><br>outbound_adsl_j160:/usr/local/etc/smokeping/conf.d@[13:35] #more Alerts <br>*** Alerts ***<br>to = 370767686@qq.com <br>from = 514906434@qq.com</span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">The above configuration is not normal mail alert.</span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> </span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"> </span></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span>370767686</span></div>
</body></html>