Commit 70ea65a9 authored by Olav Kvittem's avatar Olav Kvittem

nopoll as a parameter do have less ficed paths

parent 4104b09c
......@@ -19,7 +19,9 @@ my $rc=GetOptions(@opts);
die $usage if not $rc or $opt_h or $opt_help;
my $bb_host = $opt_bb || `hostname -f`;
my $report_host = `hostname -f`;
chomp($bb_host);
my $report_host = `hostname -s`;
chomp($report_host);
$span_limit=[0,1,9]; # sec
$bw_limit=[0,2000000, 30000]; # bps
......@@ -54,14 +56,14 @@ sub process_flow {
if ($flow->{network_stats}->{gap_avg} > 0 ){
my $jratio= $flow->{pcr_jitter}->{pcr_jitter_avg} / $flow->{network_stats}->{gap_avg};
}
&bb_report("Response", $flow->{flow_name}, bb_color($span_limit, $bb_color, $flow->{span}), $flow->{span} );
&bb_report("Response", $flow->{flow_name}, bb_color($span_limit, $bb_color, $flow->{span}), (sprintf "%.1f",$flow->{span}).'sec' );
&bb_report("Jitter", $flow->{flow_name}, bb_color($jitter_limit, $rev_color,$jratio),
$flow->{pcr_jitter}->{pcr_jitter_avg} );
(sprintf "%.1f",$flow->{pcr_jitter}->{pcr_jitter_avg}).'ms' );
my $loss_rate=0;
if ( $flow->{transport}->{mpeg_packets} > 0){
$loss_rate=100 * $flow->{transport}->{mpeg_lost_packets} / $flow->{transport}->{mpeg_packets};
}
&bb_report("Loss", $flow->{flow_name}, bb_color($loss_limit, $rev_color, $loss_rate ), $loss_rate );
&bb_report("Loss", $flow->{flow_name}, bb_color($loss_limit, $rev_color, $loss_rate ), $loss_rate."%" );
}
}
}
......@@ -85,7 +87,7 @@ sub bb_report {
return 0 if $opt_f && ! $at_end_of_file;
my ($bbtest, $machine, $color, $msg)=@_;
# my $cmd="/usr/lib/hobbit/client/bin/bb $bb_host 'status $machine.$bbtest $color $msg\n'>>$ENV{HOME}/cmd.log 2>&1";
my $cmd="/usr/lib/hobbit/client/bin/bb $bb_host 'status $machine.$bbtest $color $msg\n'";
my $cmd="/usr/lib/hobbit/client/bin/bb $bb_host 'status+35/group:$report_host $machine.$bbtest $color $msg\n'";
# system($cmd)|| warn "Command failed : $cmd : $!";
my @cmd=("/usr/lib/hobbit/client/bin/bb", "$bb_host", "status $machine.$bbtest $color $msg\n");
system(@cmd) if $opt_bb; # || warn "Command failed : @cmd : $!" ;
......
#!/bin/sh
dest=$1
not=$2 || "/etc/qstream/iptv/nopoll.cf"
tmp=/tmp/poll.cf.new$$
curl -s http://forskningsnett.uninett.no/tv/playlist.html \
| perl -ne 'if(/^#EXTINF:.*,(.*)/){$n=$1; $n=~s/\W/_/g} elsif (/^\w/){chomp;if(/239.1.1/){$op="Snap"} elsif (/233.155.107/){$op="TV2"} else{$op="Div"};printf "%s_%s;%s;-mpeg\n", $op, $n, $_}' | grep -v -f /local/net-status/iptv/nopoll.cf > $tmp
| perl -ne 'if(/^#EXTINF:.*,(.*)/){$n=$1; $n=~s/[^\w+-]/_/g} elsif (/^\w/){chomp;if(/239.1.1/){$op="Snap"} elsif (/233.155.107/){$op="TV2"} else{$op="Div"};printf "%s_%s;%s;-mpeg\n", $op, $n, $_}' | grep -v -f $not > $tmp
if test -s $tmp; then
# ci -q -l -mauto /etc/qstream/iptv/poll.cf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment