added an error message into the email if 'emailreports' can't connect to Monitorix

This commit is contained in:
Jordi Sanfeliu 2014-01-17 10:24:45 +01:00
parent fcc4e168a1
commit f29d94138d
1 changed files with 7 additions and 0 deletions

View File

@ -87,6 +87,13 @@ EOF
my $ua = LWP::UserAgent->new(timeout => 30);
my $response = $ua->request(HTTP::Request->new('GET', $url));
if(!$response->is_success) {
logger("$myself: " . $response->status_line);
$html .= "<pre>\n";
$html .= $response->status_line;
$html .= "</pre>\n";
}
my $data = $response->content;
$e = 0;
foreach ($data =~ /<!-- graph table begins -->/gi) {