Fixed in 'icecast' to show an error message when Monitorix is unable to connect to the Icecast server

This commit is contained in:
Jordi Sanfeliu 2013-02-20 16:08:57 +01:00
parent 6789db5a07
commit 0ac6b46d22
1 changed files with 5 additions and 1 deletions

View File

@ -149,9 +149,13 @@ sub icecast_update {
foreach(my @il = split(',', $icecast->{list})) {
my $ils = trim($il[$e]);
my $ua = LWP::UserAgent->new(timeout => 30);
my $response = $ua->request(HTTP::Request->new('GET', trim($_)));
my $response = $ua->request(HTTP::Request->new('GET', trim($ils)));
my $data = $response->content;
if(!$response->is_success) {
logger("$myself: ERROR: Unable to connect to '$ils'.");
}
$data =~ s/\n//g;
undef(@ls);
undef(@br);