From 1d9eefaf8b3c6ce8eb91223535cb5e8c499e6811 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 18 Oct 2023 16:40:04 +0200 Subject: [PATCH] update various hmon scripts --- hmon/QA.pm | 2 +- hmon/hmon_boxmon.pl | 0 hmon/hmon_busynew.pl | 8 ++--- hmon/hmon_ebsummary.pl | 2 +- hmon/hmon_ecal_recover_dead_slow_channels.pl | 2 +- hmon/hmon_endpoints.pl | 6 ++-- hmon/hmon_fwrate.pl | 37 ++++++++++++++++++-- hmon/hmon_hodo.pl | 0 hmon/hmon_logsts.pl | 0 hmon/hmon_padiwatemp_hodo.pl | 0 hmon/hmon_padiwatemp_itof.pl | 0 hmon/hmon_padiwatemp_start.pl | 0 hmon/index.cgi | 3 +- hmon/permanent/hmon_cpu.pl | 4 +-- hmon/permanent/hmon_eb_run.pl | 5 +-- hmon/permanent/hmon_ebdiskfill.pl | 3 +- hmon/permanent/hmon_fwhv.pl | 15 ++++---- hmon/permanent/hmon_hldlastfiles.pl | 2 +- hmon/permanent/hmon_logbook.pl | 2 +- 19 files changed, 64 insertions(+), 27 deletions(-) mode change 100755 => 100644 hmon/hmon_boxmon.pl mode change 100755 => 100644 hmon/hmon_hodo.pl mode change 100755 => 100644 hmon/hmon_logsts.pl mode change 100755 => 100644 hmon/hmon_padiwatemp_hodo.pl mode change 100755 => 100644 hmon/hmon_padiwatemp_itof.pl mode change 100755 => 100644 hmon/hmon_padiwatemp_start.pl diff --git a/hmon/QA.pm b/hmon/QA.pm index 7fb8a80..d7ca662 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -122,7 +122,7 @@ our @TdcCalibrationTemperature = (5,7,10); our @PionLvCurrLimits = (4,5,6); -our $PadiwaEcalNumber = 105; +our $PadiwaEcalNumber = 126; our @PadiwaEcalLimits = (3, 5, 8); our $PadiwaItofNumber = 18; diff --git a/hmon/hmon_boxmon.pl b/hmon/hmon_boxmon.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_busynew.pl b/hmon/hmon_busynew.pl index 3f53115..2ee9274 100755 --- a/hmon/hmon_busynew.pl +++ b/hmon/hmon_busynew.pl @@ -25,7 +25,7 @@ $plot->{titles}->[2] = "ECal"; $plot->{titles}->[3] = "RPC"; $plot->{titles}->[4] = "Rich"; $plot->{titles}->[5] = "TOF"; -$plot->{titles}->[6] = "STS"; +#$plot->{titles}->[6] = "STS"; $plot->{titles}->[7] = "Cts"; $plot->{titles}->[8] = "Start"; # $plot->{titles}->[9] = "Pion"; @@ -55,7 +55,7 @@ HPlot::PlotInit({ entries => 9, ymin => -1, ymax => 101, - bartitle => ["M12","M34","ECa","RPC","Rich","TOF","STS","Cts","St"], + bartitle => ["M12","M34","ECa","RPC","Rich","TOF/FW","","Cts","St"], buffer => 1, storable => 0, bargap => 5, @@ -111,7 +111,7 @@ while (1) { HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[1],3); #RPC HPlot::PlotAdd('BusyTimes',max($diff->{0x8000}->[7],$diff->{0x8000}->[8]),4); #Rich HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[2],5); #Tof - HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[4],6); #STS +# HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[4],6); #STS HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[0],7); #Cts HPlot::PlotAdd('BusyTimes',$diff->{0x8013}->[8],8); #Start TRB3 # HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion @@ -123,7 +123,7 @@ while (1) { HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[1],3); #RPC HPlot::PlotFill('BusyTimeBars',max($diff->{0x8000}->[7],$diff->{0x8000}->[8]),4); #Rich HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[2],5); #Tof - HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[4],6); #STS +# HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[4],6); #STS HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[0],7); #Cts HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[8],8); #Start TRB3 # HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion diff --git a/hmon/hmon_ebsummary.pl b/hmon/hmon_ebsummary.pl index 8ff6cd7..0704034 100755 --- a/hmon/hmon_ebsummary.pl +++ b/hmon/hmon_ebsummary.pl @@ -66,7 +66,7 @@ while(1){ - my $str = Hmon::MakeTitle(9, 8, "EB Summary",1); + my $str = Hmon::MakeTitle(9, 10, "EB Summary",1); $str .= "
"; $str .= "
"; $str .= ""; diff --git a/hmon/hmon_ecal_recover_dead_slow_channels.pl b/hmon/hmon_ecal_recover_dead_slow_channels.pl index 2372ecf..5cbd086 100755 --- a/hmon/hmon_ecal_recover_dead_slow_channels.pl +++ b/hmon/hmon_ecal_recover_dead_slow_channels.pl @@ -39,7 +39,7 @@ my $REGNR = 24; # number of bits to shift for the register number my $skipped_both_counter=0; -my $rh_tdc_skip_list = {6011=>1, 6012=>1, 6013=>1, 6014=>1, 6015=>1, 6050=>1, 6051=>1, 6052=>1, 6053=>1, 6054=>1, 6055=>1, 6056=>1 }; +my $rh_tdc_skip_list = {}; # {6011=>1, 6012=>1, 6013=>1, 6014=>1, 6015=>1, 6050=>1, 6051=>1, 6052=>1, 6053=>1, 6054=>1, 6055=>1, 6056=>1 }; #print Dumper $rh_tdc_skip_list; #exit; diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index db91d00..704f1f1 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -232,7 +232,8 @@ while(1) { # 0x8900,0x3800,0x3801, # 0x8910,0x3810,0x3811, #Start TRB3sc - 0x8880,0x5000,0x5001,0x5002,0x5003,0x5004,0x5005,0x5006,0x5007, + 0x8880, +# 0x5000,0x5001,0x5002,0x5003,0x5004,0x5005,0x5006,0x5007, #Hodo TRB3 # 0x8890,0x5010,0x5011, #0x5012, #Trigger @@ -292,7 +293,8 @@ while(1) { my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); $qastate = max($qastate,QA::ERROR) if $samechamberboards; $qastate = min(QA::WARN,$qastate) if !$samesectorboards; - $qastate = QA::ERROR if $mdcmissingtime > 360; + $qastate = QA::NOTE if $mdcmissingtime > 360; + $longtext .= "
Few boards missing, but for a long time. Better do a restart." if $mdcmissingtime > 360; Hmon::Speak('mdcmissonce',"$num_mdc_missing MDC Frontends missing") if($qastate > 60 && $qastate < QA::ERROR ); diff --git a/hmon/hmon_fwrate.pl b/hmon/hmon_fwrate.pl index 43023e3..a390f76 100755 --- a/hmon/hmon_fwrate.pl +++ b/hmon/hmon_fwrate.pl @@ -56,14 +56,43 @@ HPlot::PlotInit({ showvalues => 0, }); +HPlot::PlotInit ({ + name => "FwRateSimple", + file => "files/FwRateSimple", + title => "FW Rate", + entries => 32, + curves => 15, + type => HPlot::TYPE_HEATMAP, + output => HPlot::OUT_PNG, + zlabel => "Hitrate", + sizex => 310, + sizey => 310, + nokey => 1, + buffer => 1, + ymin => 14.5, + ymax => -0.5, + xmin => -0.5, + xmax => 31.5, + cbmax => "100<*<1E8", + cbmin => 0, + noinit => 1, + additional => "set logscale cb; unset ytics;set format cb \"_{10}{\%L}\"", + showvalues => 0, }); + my $str = Hmon::MakeTitle(9, 13, "FW Hit Rate",0); $str .= qq@
\n@; - $str .= Hmon::MakeFooter(); Hmon::WriteFile("FwRates",$str); +$str = Hmon::MakeTitle(4, 7, "FW Hit Rate",0); +$str .= qq@
\n@; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("FwRateSimple",$str); + + + my $old; my $oldtime = time(); my $time = time(); @@ -100,6 +129,9 @@ while(1) { if ($vdiff < 0) { $vdiff += 2**28;} $diff->{$b}->[$v] = $vdiff/$tdiff; + + HPlot::PlotFill('FwRateSimple',$diff->{$b}->[$v],$v,($b%4)+((($b>>4)%4)*5)); + # my $val = $diff->{$b}->[$v]; # HPlot::PlotFill('FwRate',$diff->{$b}->[$v],$v,$xpos); @@ -138,7 +170,8 @@ while(1) { HPlot::PlotFill('FwRate',$val,$x[$i]+3,43-$y[$i]-3); } } - HPlot::PlotDraw('FwRate'); + HPlot::PlotDrawFork('FwRate'); + HPlot::PlotDrawFork('FwRateSimple'); } # print $highrate." ".$lowrate."\n"; diff --git a/hmon/hmon_hodo.pl b/hmon/hmon_hodo.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_logsts.pl b/hmon/hmon_logsts.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_padiwatemp_hodo.pl b/hmon/hmon_padiwatemp_hodo.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_padiwatemp_itof.pl b/hmon/hmon_padiwatemp_itof.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_padiwatemp_start.pl b/hmon/hmon_padiwatemp_start.pl old mode 100755 new mode 100644 diff --git a/hmon/index.cgi b/hmon/index.cgi index b0bca6d..cadc0fe 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -53,7 +53,8 @@ function openwin(url) {
  • Main Screen 1 Eventrate & Busy
  • Main Screen 2 Spill Info
  • Main Screen 3 EBs
  • -
  • Main Screen 4 Tof Rpc STS Ecal iTOF fRPC Start rates
  • + +
  • Main Screen 4 Tof Rpc FW Ecal Start rates
  • Main Screen 5 Positional map for Start and iTOF, Trigger Rates
  • Main Screen 6 Beam Intensities
  • diff --git a/hmon/permanent/hmon_cpu.pl b/hmon/permanent/hmon_cpu.pl index b8f948d..c907580 100755 --- a/hmon/permanent/hmon_cpu.pl +++ b/hmon/permanent/hmon_cpu.pl @@ -32,7 +32,7 @@ my $fqa = QA::OpenQAFile(); # JAM 6.1.2020 - for the moment exlude hosts depcp418 and lxhaddcs03 not available # MT 2022.02.09 - all to internal HADES-VLAN CPU-names -my @srv = qw( lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb14p lxhadeb15p lxhadeb16p lxhadesdaqp lxhadeb07p lxhadeb13p hadesdaqp03 hadesdaqp04 hadesp30 hadesp57 hadesp31 hadesp33 hadesp63 hadesp66 hadesp70 lxhaddcs05p lxhaddcs06p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p); +my @srv = qw( lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb14p lxhadeb15p lxhadeb16p lxhadeb17p lxhadeb18p lxhadesdaqp lxhadeb13p lxhaddcs10p lxhaddcs11p lxhaddcs12p lxhaddcs13p hadesdaqp03 hadesdaqp04 hadesp30 hadesp57 hadesp31 hadesp33 hadesp63 hadesp66 hadesp70); my $template .= "\n
    \n
    "; for(my $d=1;$d<=32;$d++) { @@ -70,7 +70,7 @@ while(1) { my $maxstr = ""; my $busystr = ""; if (defined $laststore->{0}->{0}->{'idle'}) { - $str = Hmon::MakeTitle(9,16,"Server CPU Usage"); + $str = Hmon::MakeTitle(9,14,"Server CPU Usage"); $str .= $template; for(my $s = 0; $s < scalar @srv; $s++) { $str .= "\n
    $srv[$s]"; diff --git a/hmon/permanent/hmon_eb_run.pl b/hmon/permanent/hmon_eb_run.pl index fd6484f..9a5be6b 100755 --- a/hmon/permanent/hmon_eb_run.pl +++ b/hmon/permanent/hmon_eb_run.pl @@ -63,8 +63,9 @@ my $url_prefix = $masterurl . 'Master/BNET/RunPrefix/get.json?field="value"'; my $url_builders = $masterurl . 'Master/BNET/Builders/get.json?field="value"'; my $url_inputs = $masterurl . 'Master/BNET/Inputs/get.json?field="value"'; -#JAM2021 - location of 8800 changed to input 7 -my $url_cts_histo = $masterurl . '/BNET-IN-7/TRB8800_TdcCal/TRB_8800/TRB_8800_TrigType/get.json?field="bins"'; +#JAM2023 - location of 8800 changed to input 4 +my $url_cts_histo = $masterurl . '/BNET-IN-4/TRB8800_TdcCal/TRB_8800/TRB_8800_TrigType/get.json?field="bins"'; + my $url_master_state = $masterurl . 'Master/BNET/State/get.json?field="value"'; diff --git a/hmon/permanent/hmon_ebdiskfill.pl b/hmon/permanent/hmon_ebdiskfill.pl index e765c25..69f6d61 100755 --- a/hmon/permanent/hmon_ebdiskfill.pl +++ b/hmon/permanent/hmon_ebdiskfill.pl @@ -32,7 +32,8 @@ while (1) { for (my $d=1;$d<=15;$d++) { $str .= "$d"; } - for (my $n=8;$n<=16;$n++) { + for (my $n=8;$n<=18;$n++) { + next if $n==13; my $hostn=sprintf("lxhadeb%02d", $n); my @out = Hmon::qxtimeout("ssh $hostn \"df -h \"",10); foreach my $a (@out) { diff --git a/hmon/permanent/hmon_fwhv.pl b/hmon/permanent/hmon_fwhv.pl index 8bdcf14..a1531a9 100755 --- a/hmon/permanent/hmon_fwhv.pl +++ b/hmon/permanent/hmon_fwhv.pl @@ -44,8 +44,8 @@ HPlot::PlotInit({ ymax => 43.5, xmin => -0.5, xmax => 43.5, - #cbmax => 1600, - cbmin => 0, + cbmax => 1800, + cbmin => -1, noinit => 1, # additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"", additional => " @@ -53,7 +53,7 @@ HPlot::PlotInit({ set obj 2 rect from 15.4, 15.5 to 27.5, 27.5 lw 0.2 fs empty border -1 front \n unset ytics \n unset xtics \n - set palette defined ( -1 \"#000000\", 0 \"#0000ff\", 990 \"#00aaff\", 991 \"#00ff00\", 1400 \"#ffff00\", 1800 \"#ff0000\" ) \n + set palette defined ( -1 \"#000000\", -0.1 \"#0000ff\", 990 \"#00aaff\", 991 \"#00ff00\", 1400 \"#ffff00\", 1800 \"#ff0000\" ) \n ", showvalues => 0, }); @@ -130,7 +130,7 @@ while(1) { $ChnlsOld++; } } - + my $qastate = QA::OK; my $value = sprintf("%i/%i",$ChnlsOn, scalar @channels); @@ -156,10 +156,9 @@ while(1) { next if ($i == 218 || $i == 219 || $i == 220 || $i == 230); next if ($i == 283 || $i == 293 || $i == 294 || $i == 295); my $val = $data->{$i}->{val}; - $val = -1 if $time > ($data->{$i}{tme}//0)+600; - - # $val = $i; #TODO - +#print($time."\t".$data->{$i}{tme}."\t".(($data->{$i}{tme}//0)+600)."\t$val\t"); + $val = -1 if $time > (($data->{$i}{tme}//0)+600); +# print ($val."\n"); HPlot::PlotFill('FwHV',$val,$x[$i], 43-$y[$i]); if($i>=145) { HPlot::PlotFill('FwHV',$val,$x[$i]+1,43-$y[$i]); diff --git a/hmon/permanent/hmon_hldlastfiles.pl b/hmon/permanent/hmon_hldlastfiles.pl index b52e537..aae1c39 100755 --- a/hmon/permanent/hmon_hldlastfiles.pl +++ b/hmon/permanent/hmon_hldlastfiles.pl @@ -13,7 +13,7 @@ use QA; while(1) { my $out = Hmon::MakeTitle(4,8,"Last *.hld files"); $out .= "
     ";
    -  foreach my $i (8,9,14,15,16) {
    +  foreach my $i (8,9,10,11) {
         my $server = sprintf("lxhadeb%02i",$i);
         $out .= "$server\n";
         my $cmd = "ssh $server \"ls -rtlh /data*/data/*.hld | tail -n4\"";
    diff --git a/hmon/permanent/hmon_logbook.pl b/hmon/permanent/hmon_logbook.pl
    index 35abd9f..fe5d70a 100755
    --- a/hmon/permanent/hmon_logbook.pl
    +++ b/hmon/permanent/hmon_logbook.pl
    @@ -13,7 +13,7 @@ use JSON;
     
     
     my $firstrun =1; 
    -my $command = "curl 'https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.show' -b /tmp/cookiefile -c /tmp/cookiefile -X POST -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: de,en-US;q=0.7,en;q=0.3' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: https://hades-db.gsi.de' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: iframe' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-Fetch-User: ?1' --data-raw 'p_exp_id=MAY22TEST&p_begin=&p_end=&p_num_days=&p_num_entries=5&p_author=&p_action=Show&p_log_type=All&p_run_type=None&p_current=&p_filename=*&p_search_text=*'  -u hades:6\\\$ectors   2>/dev/null | iconv -f ISO-8859-1 -t UTF-8";
    +my $command = "curl 'https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.show' -b /tmp/cookiefile -c /tmp/cookiefile -X POST -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: de,en-US;q=0.7,en;q=0.3' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: https://hades-db.gsi.de' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: iframe' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-Fetch-User: ?1' --data-raw 'p_exp_id=FEB24&p_begin=&p_end=&p_num_days=&p_num_entries=5&p_author=&p_action=Show&p_log_type=All&p_run_type=None&p_current=&p_filename=*&p_search_text=*'  -u hades:6\\\$ectors   2>/dev/null | iconv -f ISO-8859-1 -t UTF-8";
     
     my $store;
     my $hash;
    -- 
    2.43.0