Fixed in 'traffact' to show an error message when Monitorix is unable to connect to the HTTP server

This commit is contained in:
Jordi Sanfeliu 2013-02-20 16:13:13 +01:00
parent 0ac6b46d22
commit cb36a02e57
1 changed files with 3 additions and 0 deletions

View File

@ -333,6 +333,9 @@ sub traffacct_sendreports {
$ua->request(HTTP::Request->new('GET', $url));
$url = "http://127.0.0.1" . $base_url . "/" . $imgs_dir . "traffacct" . $n . ".1month.png";
my $image = $ua->request(HTTP::Request->new('GET', $url));
if(!$image->is_success) {
logger("$myself: ERROR: Unable to connect to '$url'.");
}
# create the multipart container and add attachments
my $msg = new MIME::Lite(