Fixed 'icecast' graph to support newer statistics page format

This commit is contained in:
Jordi Sanfeliu 2014-05-28 17:43:09 +02:00
parent 00c29ccee5
commit ee80222a09
2 changed files with 17 additions and 11 deletions

View File

@ -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);
} }

View File

@ -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