mirror of https://github.com/mikaku/Monitorix.git
Fixed 'icecast' graph to support newer statistics page format
This commit is contained in:
parent
00c29ccee5
commit
ee80222a09
|
@ -160,9 +160,6 @@ sub icecast_update {
|
|||
my $rrd = $config->{base_lib} . $package . ".rrd";
|
||||
my $icecast = $config->{icecast};
|
||||
|
||||
my @ls;
|
||||
my @br;
|
||||
|
||||
my $n;
|
||||
my $rrdata = "N";
|
||||
|
||||
|
@ -183,14 +180,23 @@ sub icecast_update {
|
|||
}
|
||||
|
||||
$data =~ s/\n//g;
|
||||
undef(@ls);
|
||||
undef(@br);
|
||||
|
||||
my $iceold;
|
||||
my $icenew;
|
||||
my @bl_pairs;
|
||||
my @ls;
|
||||
my @br;
|
||||
|
||||
foreach my $i (split(',', $icecast->{desc}->{$ils})) {
|
||||
my $m = "Mount Point " . trim($i);
|
||||
my ($l) = ($data =~ m/$m.*?<tr><td>Current Listeners:<\/td><td class=\"streamdata\">(\d*?)<\/td>/g);
|
||||
my ($b) = ($data =~ m/$m.*?<tr><td>Bitrate:<\/td><td class=\"streamdata\">(\d*?)<\/td><\/tr>/g);
|
||||
$l = 0 unless defined($l);
|
||||
$b = 0 unless defined($b);
|
||||
$i = trim($i);
|
||||
$i =~ s/\//\\\//g;
|
||||
$iceold .= '<td><h3>Mount Point ' . $i . '<\/h3><\/td>.*?(?:<tr><td>Bitrate:<\/td><td class=\"streamdata\">(\d*?)<\/td><\/tr>)?<tr><td>Current Listeners:<\/td><td class=\"streamdata\">(\d*?)<\/td><\/tr>.*?<\/table>.*?';
|
||||
$icenew .= '<h3 class=\"mount\">Mount Point ' . $i . '<\/h3>.*?(?:<tr><td>Bitrate:<\/td><td class=\"streamstats\">(\d*?)<\/td><\/tr>)?<tr><td>Listeners \(current\):<\/td><td class=\"streamstats\">(\d*?)<\/td><\/tr>.*?<\/table>.*?';
|
||||
}
|
||||
(@bl_pairs) = ($data =~ m/$iceold/);
|
||||
(@bl_pairs) = ($data =~ m/$icenew/) if !scalar(@bl_pairs);
|
||||
|
||||
while(my ($b, $l) = splice(@bl_pairs, 0, 2)) {
|
||||
push(@ls, $l);
|
||||
push(@br, $b);
|
||||
}
|
||||
|
|
|
@ -1646,7 +1646,7 @@ Default value: \fIhttp://localhost:8000/status.xsl\fP
|
|||
.P
|
||||
.BI desc
|
||||
.RS
|
||||
This is a comma-separated list of mountpoints configured for every URL specified in the \fBlist\fP option.
|
||||
This is a comma-separated list of Mount Points configured for every URL specified in the \fBlist\fP option. IMPORTANT: the Mount Points must be specified in the same order that appears in the Icecast Server Status page.
|
||||
.P
|
||||
<desc>
|
||||
.br
|
||||
|
|
Loading…
Reference in New Issue