From 199f170c7b617d59e099be3871378b5e90019fc9 Mon Sep 17 00:00:00 2001 From: Hades DAQ Date: Tue, 2 Jul 2013 16:31:58 +0200 Subject: [PATCH] added data amount to ebdiskfill --- hmon/permanent/hmon_ebdiskfill.pl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hmon/permanent/hmon_ebdiskfill.pl b/hmon/permanent/hmon_ebdiskfill.pl index 26a96b5..faa083f 100755 --- a/hmon/permanent/hmon_ebdiskfill.pl +++ b/hmon/permanent/hmon_ebdiskfill.pl @@ -10,6 +10,7 @@ use Hmon; use QA; my $store = {}; +my $store2 = {}; my $laststore = {}; my $values = {}; my $color = {}; @@ -26,22 +27,22 @@ $max = 0; my $str; while (1) { $maxqa = 0; - $str = Hmon::MakeTitle(8,3,"Eventbuilder Disk Fill Level"); + $str = Hmon::MakeTitle(8,5,"Eventbuilder Disk Fill Level"); $str .= "\n
"; for (my $d=1;$d<=22;$d++) { $str .= "$d"; } - for (my $n=1;$n<=5;$n++) { + for (my $n=1;$n<=7;$n++) { my @out = Hmon::qxtimeout("ssh lxhadeb0$n \"df -h \"",10); foreach my $a (@out) { - if ($a =~ /(\d*)\%\s*\/data(\d\d)/) { - $store->{$n}->{$2} = $1; - # print $a." $1 $2\n"; - if ($1 > $max) { - $max = $1; $maxb = "$1% on lxhadeb$n Disk $2"; + if ($a =~ /\d+,?.?\d+[TGM]?\s+(\d+,?.?\d+[TGM]?)\s+(\d+,?.?\d+[TGM]?)\s+(\d*)\%\s*\/data(\d\d)/) { + $store->{$n}->{$4} = $3; + $store2->{$n}->{$4} = $2." / ".$1." = ".$3."%"; + if ($3 > $max) { + $max = $3; $maxb = "$3% on lxhadeb$n Disk $4"; } - if ($1 > $maxqa) { - $maxqa = $1; + if ($3 > $maxqa) { + $maxqa = $3; } } } @@ -51,7 +52,7 @@ while (1) { $id = '0'.$d if $d<10; $store->{$n}->{$id} = 0 unless exists $store->{$n}->{$id}; $str .= "%2i",Hmon::findcolor($store->{$n}->{$id},0,100,0),$store->{$n}->{$id}); + $str .= sprintf("style=\"background-color:%4s;\" title=\"%s\">%2i",Hmon::findcolor($store->{$n}->{$id},0,100,0),$store2->{$n}->{$id}||"",$store->{$n}->{$id}); } } -- 2.43.0