From cb36a02e5747d2b3f5d4339acdd656a6a1fddfb2 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Wed, 20 Feb 2013 16:13:13 +0100 Subject: [PATCH] Fixed in 'traffact' to show an error message when Monitorix is unable to connect to the HTTP server --- lib/traffacct.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/traffacct.pm b/lib/traffacct.pm index 704f8df..f65e42f 100644 --- a/lib/traffacct.pm +++ b/lib/traffacct.pm @@ -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(