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 $rrd = $config->{base_lib} . $package . ".rrd";
|
||||||
my $icecast = $config->{icecast};
|
my $icecast = $config->{icecast};
|
||||||
|
|
||||||
my @ls;
|
|
||||||
my @br;
|
|
||||||
|
|
||||||
my $n;
|
my $n;
|
||||||
my $rrdata = "N";
|
my $rrdata = "N";
|
||||||
|
|
||||||
|
@ -183,14 +180,23 @@ sub icecast_update {
|
||||||
}
|
}
|
||||||
|
|
||||||
$data =~ s/\n//g;
|
$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})) {
|
foreach my $i (split(',', $icecast->{desc}->{$ils})) {
|
||||||
my $m = "Mount Point " . trim($i);
|
$i = trim($i);
|
||||||
my ($l) = ($data =~ m/$m.*?<tr><td>Current Listeners:<\/td><td class=\"streamdata\">(\d*?)<\/td>/g);
|
$i =~ s/\//\\\//g;
|
||||||
my ($b) = ($data =~ m/$m.*?<tr><td>Bitrate:<\/td><td class=\"streamdata\">(\d*?)<\/td><\/tr>/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>.*?';
|
||||||
$l = 0 unless defined($l);
|
$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>.*?';
|
||||||
$b = 0 unless defined($b);
|
}
|
||||||
|
(@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(@ls, $l);
|
||||||
push(@br, $b);
|
push(@br, $b);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1646,7 +1646,7 @@ Default value: \fIhttp://localhost:8000/status.xsl\fP
|
||||||
.P
|
.P
|
||||||
.BI desc
|
.BI desc
|
||||||
.RS
|
.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
|
.P
|
||||||
<desc>
|
<desc>
|
||||||
.br
|
.br
|
||||||
|
|
Loading…
Reference in New Issue