init III
This commit is contained in:
57
Linux Gatewatch/gatewatch.txt.sh
Normal file
57
Linux Gatewatch/gatewatch.txt.sh
Normal file
@@ -0,0 +1,57 @@
|
||||
cd /opt/gate/base90/logs/gatewatch/active/
|
||||
touch gws.pl
|
||||
touch show_vem.sh
|
||||
chmod +x gws.pl show_vem.sh
|
||||
|
||||
|
||||
|
||||
|
||||
echo '
|
||||
#!/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, DATE;
|
||||
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\n", $host, $total, $rreq, $lost, $date;
|
||||
}
|
||||
|
||||
|
||||
close HANDLE;
|
||||
'>gws.pl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo '
|
||||
#!/usr/bin/bash
|
||||
#ls -1 GW*.log
|
||||
for i in GW*.log
|
||||
do
|
||||
./gws.pl $i | grep VEMXTR2
|
||||
done
|
||||
'>show_vem.sh
|
||||
Reference in New Issue
Block a user