init III
This commit is contained in:
26
Linux Gatewatch/gws.pl
Normal file
26
Linux Gatewatch/gws.pl
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
if (-f $ARGV[0]) {
|
||||
open FH, "<$ARGV[0]";
|
||||
}
|
||||
else {
|
||||
die "Datei nicht gefunden \"$ARGV[0]\"\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (<FH>) {
|
||||
push (@LINES, $_) if($_ =~ /ALL/);
|
||||
}
|
||||
|
||||
# Name Id Address Xervice Stream FilterIndex total rerequested lost last reset
|
||||
#VEMXTR2 21002 ALL ALL ALL ALL 2677 31 0 Tue Feb 5 06:30:00 2013
|
||||
|
||||
printf "\n%15s | %10s | %10s | %10s | %s\n", HOST, TOTAL, RREQ, LOST, 'LAST START';
|
||||
printf "---------------------------------------------------------------------------------\n";
|
||||
foreach (@LINES) {
|
||||
($host,$id,undef,undef,undef,undef,$total,$rreq,$lost,$date) = $_ =~ /([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s]*) *([^\s].*)/;
|
||||
printf "%15s | %10s | %10s | %10s | %s | %s\n", $host, $total, $rreq, $lost, $date, $ARGV[0];
|
||||
}
|
||||
|
||||
close HANDLE;
|
||||
Reference in New Issue
Block a user