From: hadaq Date: Thu, 3 Feb 2022 22:47:49 +0000 (+0100) Subject: update hmon files X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a5bad1e830bb651517310d469296d3af2257b7da;p=hadesdaq.git update hmon files --- diff --git a/hmon/QA.pm b/hmon/QA.pm index d6c2472..f4757f7 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -50,7 +50,7 @@ $entries->{'server'} = ['fill', 'cpu', '', '', 'onlineqa']; #icinga, pwrsup $entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits']; $entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; $entries->{'endp'} = ['mdc','rich', 'tof', 'rpc', 'other']; -$entries->{'feeerr'} = ['feeerr','trginp','trgqual','rpc','']; +$entries->{'feeerr'} = ['feeerr','trginp','trgqual','rpc','tof']; $entries->{'rich'} = ['temp','LV','bkpl','isob','richthr']; $entries->{'padiwa'} = ['ecal','start','itof','hodo','sts']; $entries->{'hv'} = ['richhv','ecalhv','rpchv','fwhv','tofhv']; @@ -91,9 +91,9 @@ our @RichInnerTempLimits = (34.3,35.2,36); our @TrgErrLimits = (100, 1000, 10000); our @CPULimits = (95, 100, 100); our @TimeoutLimits = (0, 0, 1); -our @TimeoutLimitsOnlyRICHMDC = (0, 3, 4); +our @TimeoutLimitsOnlyRICHMDC = (0, 5, 10); our @LinkErrLimits = (50, 500, 1000); -our @MdcEndpMissingLimits = (0, 2, 3); #!!! Oh dear. +our @MdcEndpMissingLimits = (0, 5, 8); #!!! Oh dear. our @RichEndpMissingLimits = (0, 3, 4); our @TofEndpMissingLimits = (0, 0, 0); our @RpcEndpMissingLimits = (0, 0, 0); @@ -103,7 +103,7 @@ our $TrgCheckPolarity = 1; our @Eventsbroken = (.5,2,5); our @MdcTokenMissLimits = (10,50,100); our @MdcNominalHV = (1750,1770,1900,2150); -our $MdcHVOffsetLimits = [[5,10,55],[5,10,55],[5,10,55],[10,110,125]]; +our $MdcHVOffsetLimits = [[5,10,255],[5,10,255],[5,10,255],[10,110,325]]; our @EcalHvLimits = (493,325,320); our @RpcHvLimits = (12,12,12); our @TofHvLimits = (764,760,759); @@ -155,7 +155,7 @@ our $QAServerOff = 0; # Missing Boards ############################################################################### -our @mdc_boards_removed =(); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23 +our @mdc_boards_removed =(0x2203); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23 our @mdc_chambers_removed =(); our @rich_boards_removed =(); our @tof_boards_removed =(); @@ -321,6 +321,7 @@ sub SciNotation { return sprintf("%.1fM", $v / 1000000.) if (abs($v) < 20E6) ; return sprintf("%iM", $v / 1000000.) if (abs($v) < 1E9) ; return sprintf("%.2fG", $v / 1E9) if (abs($v) < 20E9) ; + return sprintf("%.1fG", $v / 1E9) if (abs($v) < 100E9) ; return sprintf("%i",$v); } else { diff --git a/hmon/doc/daq-busy.htt b/hmon/doc/daq-busy.htt index f3e6313..7998e60 100644 --- a/hmon/doc/daq-busy.htt +++ b/hmon/doc/daq-busy.htt @@ -15,15 +15,16 @@ During normal operation, the full message gives the busy times for all sub-syste

Additional notes

+
Note that in many cases this is not the real source of the error - +e.g. if the data transport to EB failed, the board with the smallest +buffer and the most data gets busy first. -
Note that in many cases this is not the real source of the error - -e.g. if the data transport to EB failed, the board with the smallest -buffer and the most data gets busy first.

*The list of addresses can be found on the main monitoring web page. diff --git a/hmon/doc/eb-errbits.htt b/hmon/doc/eb-errbits.htt index 59a1ebd..598e4e6 100644 --- a/hmon/doc/eb-errbits.htt +++ b/hmon/doc/eb-errbits.htt @@ -2,9 +2,17 @@

The number of accepted events (written to disk) with errors reported by the front-ends.

Error handling

-
Try to do a DAQ restart +Check the long error message for the subsystems that cause the most errors, then try to solve these. + +
Partially Missing errors usually refer to a detector with a lot of noise, try to reload thresholds for the corresponding detector. A few errors of this type are perfectly normal. +
TriggerNumberMismatch TriggerCodeMismatch errors are usually a problem in the hubs - if a DAQ restart doesn't help, try a reboot of the corresponding hubs (in RICH: combiners, or hubs). +
TimingTriggerError A board has problems receiving the reference time for the event. Check the "Trigger" box for more details. +
If the reason is unclear, try to do a DAQ restart
In some cases a reload or power-cycle of the corresponding system / chamber is necessary. +
Error counters are cleared at DAQ restart. If you want to clear them manually, use the Eventbuilder GUI and click the "Hist" button. + + diff --git a/hmon/doc/eb-lostevt.htt b/hmon/doc/eb-lostevt.htt index 416ea94..5584cce 100644 --- a/hmon/doc/eb-lostevt.htt +++ b/hmon/doc/eb-lostevt.htt @@ -1,13 +1,13 @@

Number of discarded events

-This button gives you the number of discarded events in the Eventbuilders. Few discarded events (<1%) are fine. +This button gives you the number of discarded events in the Eventbuilders. Few discarded events (<1%) are acceptable.

Error Handling

Check the datarate that is delivered by DAQ
If many events are lost, the EB might be overloaded. Check that the trigger rate is about the expected value.
-
Check that the number of eventbuilders can handle the intended datarate. Beam runs require at least 4 builder nodes, 8 is usual. Try to increase the number of event builders using the buttons "Set x EB" in the operator GUI
+
Check that the number of eventbuilders can handle the intended datarate. Beam runs require at least 10 builder nodes. Try to increase the number of event builders using the buttons "Set x EB" in the operator GUI
Check in the EB summary that writing data to local disk and TSM/lustre is working. There might be backpressure if too much data is written to tape. Try reducing the trigger rate.
Restart the Eventbuilders
diff --git a/hmon/doc/eb-run.htt b/hmon/doc/eb-run.htt index 7e1487e..1e3e88e 100644 --- a/hmon/doc/eb-run.htt +++ b/hmon/doc/eb-run.htt @@ -1,9 +1,9 @@

Number of running Eventbuilders

-Shown is the number of input nodes (i:5) and builder nodes (b:8) of the buider network BNET.
-The input nodes are the data receivers from the detector front-ends. Their number should be always 5.
+Shown is the number of input nodes (i:7) and builder nodes (b:10) of the buider network BNET.
+The input nodes are the data receivers from the detector front-ends. Their number should be always 7.
The builder nodes are the parallel Eventbuilders writing data to disc. Their number depends on the setup:
-(Cosmics: 1 EB, Beamtime: 8 EB) Number of builders may be changed with the "Set x EB" button on operator GUI
+(Cosmics: 1 EB, Beamtime: 10 EB) Number of builders may be changed with the "Set x EB" button on operator GUI
Also shown is the file prefix currently written ("be"). For data taking with beam this should be "be"

diff --git a/hmon/doc/feeerr-tof.htt b/hmon/doc/feeerr-tof.htt new file mode 100644 index 0000000..8cb3f74 --- /dev/null +++ b/hmon/doc/feeerr-tof.htt @@ -0,0 +1,5 @@ +

RPC Thresholds

+Monitors the noise level in TOF. Sometimes noise in a part of the detector gets too high because of problems with the thresholds. Problems should also be visible in the rate plots for the detector (in one of the main operator windows). +

Error Handling

+Use "Thresholds TOF" to reload the proper settings. A DAQ restart is not needed. +
If the situation doesn't change, inform the TOF operator. diff --git a/hmon/hmon_busynew.pl b/hmon/hmon_busynew.pl index a4c9ef2..285b7a2 100755 --- a/hmon/hmon_busynew.pl +++ b/hmon/hmon_busynew.pl @@ -181,8 +181,8 @@ while (1) { my $maxpercent = max(@{$diff->{0x8000}}); my $msgstr = sprintf("%3.1f%%",$maxpercent); my $qastate = QA::OK; - $qastate = QA::WARN if ($maxpercent > 50); - $qastate = QA::WARN_2 if ($maxpercent > 75); + $qastate = QA::WARN if ($maxpercent > 70); + $qastate = QA::WARN_2 if ($maxpercent > 80); $qastate = QA::ERROR if ($maxpercent > 99); QA::WriteQALog($fqa,"daq","busy",5,$qastate,"Busy",$msgstr,"") unless ($maxpercent >= 99); } diff --git a/hmon/hmon_eberrbits_withreset.pl b/hmon/hmon_eberrbits_withreset.pl index 5d70d95..39cf172 100755 --- a/hmon/hmon_eberrbits_withreset.pl +++ b/hmon/hmon_eberrbits_withreset.pl @@ -221,7 +221,7 @@ foreach my $k (sort keys %$store) { $store->{$k}->{$b}, $perc, $bits[$b]); - $longstring .= $ts; + $longstring .= $ts."
"; $brokenevents += $store->{$k}->{$b}; } } @@ -231,7 +231,7 @@ foreach my $k (sort keys %$store) { $longstring = "Total Events in file: ".($store->{TRB_8800}->{0} || "")." - ". "Events with errors: ".$value." - ". $longstring; - chop $longstring;chop $longstring;chop $longstring; + chop $longstring;chop $longstring;chop $longstring;chop $longstring;chop $longstring;chop $longstring;chop $longstring; print "$longstring \n" if $opt_debug; $qastate = QA::GetQAState('below', $sumperc, @QA::Eventsbroken); QA::WriteQALog($flog, "eb", "errbits", 10, diff --git a/hmon/hmon_ecalresetthresholds.pl b/hmon/hmon_ecalresetthresholds.pl new file mode 100755 index 0000000..8f50c50 --- /dev/null +++ b/hmon/hmon_ecalresetthresholds.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use Data::Dumper; +use Hmon; +use QA; +use HADES::TrbNet; +use POSIX qw(strftime); +my $fh; + + +trb_init_ports() or die trb_strerror(); +my $inspill; +while (1) { + do{{ + sleep(1); + my $o = trb_register_read(0x10,0x905d); + $inspill = $o->{0x10} >> 31; +# print ".\n"; + }}while($inspill); + + system ("/home/hadaq/trbsoft/daq/ecal/ecal_set_thresholds.pl"); + +# system ("/home/hadaq/trbsoft/daq/ecal/ecal_set_thresholds_sec2_sec4.pl"); + + + sleep(15); + } diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index 99012e3..e274c8c 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w use strict; use warnings; @@ -9,6 +9,7 @@ use QA; use Getopt::Long; use Data::Dumper; use List::MoreUtils qw(uniq); +use List::Util qw(max); use HADES::TrbNet; trb_init_ports() or die trb_strerror(); @@ -250,7 +251,7 @@ while(1) { my @sorted_mdc_results = sort @{$mdc_results[2]}; $mdcmissingtime = 0 if $num_mdc_missing == 0; - $mdcmissingtime += $num_mdc_missing; + $mdcmissingtime += max(0,$num_mdc_missing-2); #Are two boards from the same chamber missing? my @mdcboards = @sorted_mdc_results; @@ -259,6 +260,12 @@ while(1) { my $samechamberboards = 0; if(scalar @mdcboards != scalar @uniqchambers) {$samechamberboards = 1;} + #Are two boards from the same sector missing? + chop(@mdcboards); + @uniqchambers = uniq @mdcboards; + my $samesectorboards = 0; + if(scalar @mdcboards != scalar @uniqchambers) {$samesectorboards = 1;} + print $fh "$num_mdc_missing\n"; $fh->autoflush(1); seek($fh, 0, 0); @@ -273,8 +280,9 @@ while(1) { my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); $qastate = QA::ERROR if $samechamberboards; + $qastate = QA::WARN if $samesectorboards; $qastate = QA::ERROR if $mdcmissingtime > 360; - $longtext .= "
Few boards missing, but for a long time. Better do a restart." if $mdcmissingtime > 1800; + $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 ); Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate >= QA::ERROR ); diff --git a/hmon/hmon_frpcrate.pl b/hmon/hmon_frpcrate.pl index a686422..8e164e0 100755 --- a/hmon/hmon_frpcrate.pl +++ b/hmon/hmon_frpcrate.pl @@ -32,7 +32,7 @@ HPlot::PlotInit({ ymax => -0.5, xmin => -0.5, xmax => 15.5, - cbmax => "100<*<1E5", + cbmax => "100<*<1E7", cbmin => 0, noinit => 1, additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"", diff --git a/hmon/hmon_itofrate.pl b/hmon/hmon_itofrate.pl index 234a9de..2b6ad1e 100755 --- a/hmon/hmon_itofrate.pl +++ b/hmon/hmon_itofrate.pl @@ -32,7 +32,7 @@ ymin => 23.5, ymax => -0.5, xmin => -0.5, xmax => 15.5, -cbmax => "100<*<1E5", +cbmax => "100<*<1E7", cbmin => 0, noinit => 1, additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"", diff --git a/hmon/hmon_logfrpc.pl b/hmon/hmon_logfrpc.pl new file mode 100755 index 0000000..58e7769 --- /dev/null +++ b/hmon/hmon_logfrpc.pl @@ -0,0 +1,50 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use Data::Dumper; +use Hmon; +use QA; +use HADES::TrbNet; +use POSIX qw(strftime); +my $fh; + + +trb_init_ports() or die trb_strerror(); +my $inspill; +while (1) { + do{{ + sleep(1); + my $o = trb_register_read(0x10,0x905d); + $inspill = $o->{0x10} >> 31; +# print ".\n"; + }}while($inspill); + + + my $o = trb_register_read_mem(0xfe47,0xdfc0,0,32); + sleep 1; + my $p = trb_register_read_mem(0xfe47,0xdfc0,0,32); + my @diff; + foreach my $b (sort keys %$p) { + next if ($b < 0x6800 || $b > 0x6813); + for my $v (0..31) { + my $d = ($p->{$b}[$v]&0xffffff)-($o->{$b}[$v]&0xffffff); + $d += 2**24 if $d < 0; + push(@diff, $d); + } + } +my $day = strftime("%Y%m%d",localtime()); + + my $str = ""; + $str .= strftime("%Y.%m.%d %H:%M:%S",localtime())."\t"; + $str .= time()."\t"; + for my $i (0..scalar @diff -1) { + $str .= sprintf("%u\t",$diff[$i]); + } + $str .= "\n"; + open($fh, ">>",Hmon::HMONDIR."/archive/frpcscalerlog-$day.csv"); + print $fh $str; +# print $str; + close $fh; + sleep(50); + } diff --git a/hmon/hmon_rate2.pl b/hmon/hmon_rate2.pl index cf832d8..88e80ed 100755 --- a/hmon/hmon_rate2.pl +++ b/hmon/hmon_rate2.pl @@ -155,6 +155,7 @@ while (1) { $state, 'PT3 Rate', $shorttext, $longtext); $state = QA::OK; +# $state = QA::WARN_2 if $offset->{0xa025} > 100; $shorttext = QA::SciNotation($store{0xa025})." / ".getCorrected($store{0xa025},$offset->{0xa025}); $longtext = sprintf("Trigger Rate from PT2 %i Hz / %i Hz after offset correction",$store{0xa025}, getCorrectedValue($store{0xa025},$offset->{0xa025}) ); QA::WriteQALog($fqa, "rate", "pt2", 10, diff --git a/hmon/hmon_spill.pl b/hmon/hmon_spill.pl index deb1869..49dbbca 100755 --- a/hmon/hmon_spill.pl +++ b/hmon/hmon_spill.pl @@ -136,7 +136,7 @@ while (1) { HPlot::PlotDraw("EvtsPerSpill") unless $opt_debug>0; $events = 0; $spilllength = 0; - } elsif ($spilllength > 20) { + } elsif ($spilllength > 30) { QA::WriteQALog($fqa, "trg", "spill", 30, QA::NOTE, "Spill Sum", "No Spills", "No Spills detected at the moment") unless $opt_debug>0;; #print $spilllength."\n" unless $spilllength%10; diff --git a/hmon/hmon_startrate.pl b/hmon/hmon_startrate.pl index 9fe54c8..b41e2b5 100755 --- a/hmon/hmon_startrate.pl +++ b/hmon/hmon_startrate.pl @@ -151,7 +151,7 @@ HPlot::PlotInit($plot7); my $plot7a = { name => "StartRateY_histbar_short", file => "files/StartRateY_histbar_short", - entries => 200, + entries => 400, type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11"], @@ -160,7 +160,7 @@ my $plot7a = { sizex => 950, sizey => 330, xmin => 0, - xmax => 200, + xmax => 400, ymin => "0", ymax => "100<*", curves => 12, @@ -455,11 +455,11 @@ my $empties_x_1 = 0; my $empties_y_1 = 0; -my($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $spillEnds_x_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0); -my($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0, $spillEnds_y_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0); +my($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $spillEnds_x_0, $avgRate_x_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0); +my($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0, $spillEnds_y_0, $avgRate_y_0) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0); -my($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $spillEnds_x_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0); -my($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1, $spillEnds_y_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0); +my($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $spillEnds_x_1, $avgRate_x_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0); +my($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1, $spillEnds_y_1, $avgRate_y_1) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0); my $maxTotalX; my $maxTotalY; @@ -891,23 +891,23 @@ while(1) { $spillends = $inspill == 0 && $lastinspill == 1; if($spillends){ - ($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $time_x_0, $empties_x_0, $spillEnds_x_0) = spillAnalysisACCSIG(\@totalDetectorHitsX_0, \@lastspills_x_0, $time_x_0, $empties_x_0); + ($max_x_0, $duty_x_0, $total_x_0, $spillmin_x_0, $spillmax_x_0, $spillavg_x_0, $flucqual_x_0, $offtime_x_0, $length_x_0, $time_x_0, $empties_x_0, $spillEnds_x_0, $avgRate_x_0) = spillAnalysisACCSIG(\@totalDetectorHitsX_0, \@lastspills_x_0, $time_x_0, $empties_x_0); $maxTotalX= calculateMaximumRate(\@totalDetectorHitsX_0,\@totalDetectorHitsX_1); $maxTotalY= calculateMaximumRate(\@totalDetectorHitsY_0,\@totalDetectorHitsY_1); @totalDetectorHitsX_0 = (); - ($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0,$time_y_0, $empties_y_0, $spillEnds_y_0) = spillAnalysisACCSIG(\@totalDetectorHitsY_0, \@lastspills_y_0, $time_y_0, $empties_y_0); + ($max_y_0, $duty_y_0, $total_y_0, $spillmin_y_0, $spillmax_y_0, $spillavg_y_0, $flucqual_y_0, $offtime_y_0, $length_y_0, $time_y_0, $empties_y_0, $spillEnds_y_0, $avgRate_y_0) = spillAnalysisACCSIG(\@totalDetectorHitsY_0, \@lastspills_y_0, $time_y_0, $empties_y_0); @totalDetectorHitsY_0 = (); # added W.K. 01.2.22 to include values of whole detector in plots - ($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $time_x_1, $empties_x_1, $spillEnds_x_1) = spillAnalysisACCSIG(\@totalDetectorHitsX_1, \@lastspills_x_1, $time_x_1, $empties_x_1); + ($max_x_1, $duty_x_1, $total_x_1, $spillmin_x_1, $spillmax_x_1, $spillavg_x_1, $flucqual_x_1, $offtime_x_1, $length_x_1, $time_x_1, $empties_x_1, $spillEnds_x_1, $avgRate_x_1) = spillAnalysisACCSIG(\@totalDetectorHitsX_1, \@lastspills_x_1, $time_x_1, $empties_x_1); @totalDetectorHitsX_1 = (); - ($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1,$time_y_1, $empties_y_1, $spillEnds_y_1) = spillAnalysisACCSIG(\@totalDetectorHitsY_1, \@lastspills_y_1, $time_y_1, $empties_y_1); + ($max_y_1, $duty_y_1, $total_y_1, $spillmin_y_1, $spillmax_y_1, $spillavg_y_1, $flucqual_y_1, $offtime_y_1, $length_y_1, $time_y_1, $empties_y_1, $spillEnds_y_1, $avgRate_y_1) = spillAnalysisACCSIG(\@totalDetectorHitsY_1, \@lastspills_y_1, $time_y_1, $empties_y_1); @totalDetectorHitsY_1 = (); @@ -924,7 +924,7 @@ while(1) { # HPlot::PlotAdd("StartSpillSumX_0", $total_x_0,0); # changed W.K 01.02.22 max_x and total_x for whole detector - HPlot::PlotAdd("StartDutyFactorX_0", $duty_x_0,0); + HPlot::PlotAdd("StartDutyFactorX_0", ($avgRate_x_0+$avgRate_x_1)/$maxTotalX,0); HPlot::PlotAdd("StartSpillPeakX_0", $maxTotalX,0); HPlot::PlotAdd("StartSpillSumX_0", $total_x_0+$total_x_1,0); # end changed @@ -937,10 +937,11 @@ while(1) { # $str .= "
Last Sum".QA::SciNotation($total_x_0); # changed W.K. 01.02.22 total spill sum total_x=total_x_1+total_x_0 - $str .= "
Last Sum".QA::SciNotation( $maxTotalX); +# $str .= "
Last Sum".QA::SciNotation( $maxTotalX); + $str .= "
Last Sum".QA::SciNotation( $total_x_0+$total_x_1); # end changed - $str .= "Last Duty".sprintf("%0.3f",$duty_x_0); + $str .= "Last Duty".sprintf("%0.3f",($avgRate_x_0+$avgRate_x_1)/$maxTotalX); $str .= "
Last Duration".$length_x_0; $str .= "Last Break".$offtime_x_0." s"; # $str .= "
Last Max".QA::SciNotation($max_x_0)." Hz (100ms)"; @@ -961,7 +962,7 @@ while(1) { # HPlot::PlotAdd("StartSpillPeakY_0", $max_y_0,0); # HPlot::PlotAdd("StartSpillSumY_0", $total_y_0,0); # changed W.K 01.02.22 - HPlot::PlotAdd("StartDutyFactorY_0", $duty_y_0,0); + HPlot::PlotAdd("StartDutyFactorY_0", ($avgRate_y_0+$avgRate_y_1)/$maxTotalY,0); HPlot::PlotAdd("StartSpillPeakY_0",$maxTotalY,0); HPlot::PlotAdd("StartSpillSumY_0", $total_y_0+$total_y_1,0); # end changed @@ -977,10 +978,11 @@ while(1) { # $str .= "
Last Sum".QA::SciNotation($total_x_0); # changed W.K. 01.02.22 - $str .= "
Last Sum".QA::SciNotation($maxTotalY); +# $str .= "
Last Sum".QA::SciNotation($maxTotalY); + $str .= "\s*$/) {$cnt = 0;$found=1;}; + if ($line =~ /^$!!; + $str =~ s!
$!!; + chomp $str; + return $str; + } + diff --git a/hmon/permanent/hmon_mdchv.pl b/hmon/permanent/hmon_mdchv.pl index 4019a2c..932e006 100755 --- a/hmon/permanent/hmon_mdchv.pl +++ b/hmon/permanent/hmon_mdchv.pl @@ -207,14 +207,14 @@ while(1) { my $ch_qastate = QA::OK; my $chamberHVmin = min($data->{"$p-$s-0-V"}->{val},$data->{"$p-$s-1-V"}->{val}); - if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = max($qastate,QA::WARN);} - if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = max($qastate,QA::WARN_2);} - if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = max($qastate,QA::ERROR);} + if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][0]) {$qastate = QA::WARN;} + if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][1]) {$qastate = QA::WARN_2;} + if($chamberHVmin < $QA::MdcNominalHV[$p-1] - $QA::MdcHVOffsetLimits->[$p-1][2]) {$qastate = QA::ERROR;} if ($ch_qastate >= QA::WARN_2) { $errortimer[$chamnum]++; $ch_qastate = QA::ERROR if $errortimer[$chamnum] > 220 ; - $ch_qastate = QA::WARN_2 if $errortimer[$chamnum] <= 220 ; + $ch_qastate = QA::WARN if $errortimer[$chamnum] <= 220 ; $chamberswitherror++ if $errortimer[$chamnum] > 10 ; } else { diff --git a/hmon/permanent/hmon_stslv.pl b/hmon/permanent/hmon_stslv.pl index 977d5a5..f72e86c 100755 --- a/hmon/permanent/hmon_stslv.pl +++ b/hmon/permanent/hmon_stslv.pl @@ -15,7 +15,7 @@ use HPlot; my $flog = QA::OpenQAFile(); -my @lim = (2.96,2.96,2.7,2.6); +my @lim = (2.96,2.96,2.96,2.96); while(1) { diff --git a/hmon/permanent/hmon_vertexplots.pl b/hmon/permanent/hmon_vertexplots.pl index f66dc71..9867dc8 100755 --- a/hmon/permanent/hmon_vertexplots.pl +++ b/hmon/permanent/hmon_vertexplots.pl @@ -29,11 +29,11 @@ while(1) { $out .= "
Last Sum".QA::SciNotation($total_y_0+$total_y_1); # end changed - $str .= "Last Duty".sprintf("%0.3f",$duty_y_0); + $str .= "Last Duty".sprintf("%0.3f",($avgRate_y_0+$avgRate_y_1)/$maxTotalY); $str .= "
Last Duration".$length_y_0; $str .= "Last Break".$offtime_y_0." s"; # $str .= "
Last Max".QA::SciNotation($max_y_0)." Hz (100ms)"; @@ -1135,14 +1137,14 @@ sub spillAnalysisACCSIG{ my @totalDetectorHits = @{$totalDetectorHitsReference}; my @lastSpills = @{$lastSpillReference}; - my ($max, $duty, $total, $spillmin, $spillmax, $spillavg, $flucqual, $offtime, $length, $spillEnds) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0); + my ($max, $duty, $total, $spillmin, $spillmax, $spillavg, $flucqual, $offtime, $length, $spillEnds, $avg) = (0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0); #end of spill signaled by last 15 readouts having an average below spillThreshold entries and the one before having more # if($inspill == 0 && $lastinspill == 1){ $max = max(@totalDetectorHits); my $samples = scalar @totalDetectorHits; - my $avg = sum(@totalDetectorHits)/$samples; + $avg = sum(@totalDetectorHits)/$samples; $duty = $avg/($max||1); $total = sum(@totalDetectorHits)/$samplesPerSecond;# sum and mulitply by bin width -> Integral. Gives total hits in a spill @@ -1162,7 +1164,7 @@ sub spillAnalysisACCSIG{ # @totalDetectorHits = (); # $lastinspill = $inspill; - return ($max, $duty, $total, $spillmin, $spillmax, $spillavg, $flucqual, $offtime, $length,$time, $empties, 1); + return ($max, $duty, $total, $spillmin, $spillmax, $spillavg, $flucqual, $offtime, $length,$time, $empties, 1, $avg); # } # $lastinspill = $inspill; # return (0, 0, 0, 0, 0, 0, 0, 0, 0, 0); diff --git a/hmon/hmon_startratesimple.pl b/hmon/hmon_startratesimple.pl index 8a2ce6c..bb35a11 100755 --- a/hmon/hmon_startratesimple.pl +++ b/hmon/hmon_startratesimple.pl @@ -38,7 +38,7 @@ my $plot1 = { ymax => -0.5, xmin => -0.5, xmax => 15.5, - cbmax => "100<*<1E5", + cbmax => "100<*<1E8", cbmin => 0, noinit => 1, additional => "set logscale cb; unset ytics;set format cb \"_{10}{\%L}\"", diff --git a/hmon/hmon_stsrate.pl b/hmon/hmon_stsrate.pl index 8e64b10..4cbc49d 100755 --- a/hmon/hmon_stsrate.pl +++ b/hmon/hmon_stsrate.pl @@ -32,7 +32,7 @@ ymin => 79.5, ymax => -0.5, xmin => -0.5, xmax => 47.5, -cbmax => "100<*<1E5", +cbmax => "100<*<1E7", cbmin => 0, noinit => 1, additional => "set logscale cb;set format cb \"_{10}{\%L}\";set xtics ('0' -0.5, '8' 7.5, '16' 15.5, '24' 23.5, '32' 31.5, '40' 39.5); set grid xtics front;", diff --git a/hmon/hmon_tofrate.pl b/hmon/hmon_tofrate.pl index 15c6ebe..1ce074a 100755 --- a/hmon/hmon_tofrate.pl +++ b/hmon/hmon_tofrate.pl @@ -14,6 +14,8 @@ use List::Util qw[min max]; use Encode qw(encode from_to); use JSON::XS; +my $fqa = QA::OpenQAFile(); + my $plot1 = { name => "TofRate", @@ -53,7 +55,14 @@ my $time = time(); my $diff; my $iter = 0; +my $lowratelimit = 200; +my $highratelimit = 50000; +my $lowratecount = 500; +my $highratecount = 30; +my $qastate = QA::OK; +my $text = "OK"; +my $shorttext = "OK"; trb_init_ports() or die trb_strerror(); @@ -62,7 +71,7 @@ while(1) { #my $data; #my $max = 0 ; #my $min = 5E9; - + my $lowrate = 0; my $highrate = 0; my $o = trb_register_read_mem(0xfe47,0xdfc0,0,32) or die trb_strerror() or sleep 5 and next; if (defined $old) { @@ -77,33 +86,32 @@ while(1) { if ($vdiff < 0) { $vdiff += 2**28;} $diff->{$b}->[$v] = $vdiff/$tdiff; - #$ratesum += $diff->{$b}->[$v+1]; HPlot::PlotFill('TofRate',$diff->{$b}->[$v],$v,$xpos); + + $highrate++ if ($diff->{$b}->[$v] > $highratelimit); + $lowrate++ if ($diff->{$b}->[$v] < $lowratelimit); } - #my $s = sprintf("0x%04x",$b); - #$data->{$s}= int(100*($ratesum / 32) +0.5) /100; - - #$min = $data->{$s} if $data->{$s} < $min; - #$max = $data->{$s} if $data->{$s}> $max; } HPlot::PlotDraw('TofRate'); - - - - # $data->{max} = $max; - # $data->{min} = $min; - # $data->{symbol} = " Hits/s"; - # $data->{title} = "Mean DiRICH TDC Rate"; - - - # $data->{updatetime} = getTimeString; - - # my $fh; - # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json"); - # print $fh encode_json($data); - # close $fh; + } + + if($lowrate > $lowratecount) { + + $qastate = QA::OK; + $text = "OK"; + $shorttext = "OK"; + if ($highrate > $highratecount) { + $qastate = QA::ERROR; + $shorttext = "Problem"; + $text = "Some TOF channels seem to have too high rates."; + } + + QA::WriteQALog($fqa,"feeerr","tof", 60, $qastate, "TOF Thresh", $shorttext, $text); + } + + $old = $o; $oldtime = time(); sleep 2; diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index 3accfd8..24405d5 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -219,52 +219,52 @@ my $longmsgcheck = $longmsg; QA::WriteQALog($fqa, "trg", "source", 10, $qastate, "Trigger Source", $msg, $longmsg); QA::WriteQALog($fqa, "trg", "accepted", 10, $qastateacc, "Accept. PT3", $accmsg, $acclmsg); - my $qastatept = QA::OK; - my $ptoverStattart = $rStat->{3}->[0x24]/($rStat->{3}->[0x2c] || 1)*100; - if ($ptoverStattart > 100) {$ptoverStattart = 100;} -###################################### -## QA check for PT3/Start rate - if ($ptoverStattart > 100 || $ptoverStattart < 0) { - $qastatept = QA::WARN; - } -###################################### - my $ptmsg = ""; - $ptmsg = sprintf("%s/s / %1.2f%%",QA::SciNotation($rStat->{3}->[0x24]),$ptoverStattart) if $ptoverStattart<=10; - $ptmsg = sprintf("%i/s / %1.1f%%",$rStat->{3}->[0x26],$ptoverStattart) if $ptoverStattart> 10; - my $ptlongmsg = sprintf("PT1 counts per second: %i - PT1 / Start: %1.2f%%", $rStat->{3}->[0x24], $ptoverStattart); +# my $qastatept = QA::OK; +# my $ptoverStattart = $rStat->{3}->[0x24]/($rStat->{3}->[0x2c] || 1)*100; +# if ($ptoverStattart > 100) {$ptoverStattart = 100;} +# ###################################### +# ## QA check for PT3/Start rate +# if ($ptoverStattart > 100 || $ptoverStattart < 0) { +# $qastatept = QA::WARN; +# } +# ###################################### +# my $ptmsg = ""; +# $ptmsg = sprintf("%s/s / %1.2f%%",QA::SciNotation($rStat->{3}->[0x24]),$ptoverStattart) if $ptoverStattart<=10; +# $ptmsg = sprintf("%i/s / %1.1f%%",$rStat->{3}->[0x26],$ptoverStattart) if $ptoverStattart> 10; +# my $ptlongmsg = sprintf("PT1 counts per second: %i - PT1 / Start: %1.2f%%", $rStat->{3}->[0x24], $ptoverStattart); # QA::WriteQALog($fqa, "trg", "ptrate", 10, $qastatept, "PT1 / Start", $ptmsg, $ptlongmsg); - my $startsum = 0; - my $qastatstart = QA::OK; - my $startmsg = ""; - my $startlongmsg = ""; - - foreach my $i (0..7) { - $startsum += $rStat->{3}->[$i+0x8] ; - } - $spillsum += $startsum; - -# $startsum = $rStat->{3}->[0x29]; +# my $startsum = 0; +# my $qastatstart = QA::OK; +# my $startmsg = ""; +# my $startlongmsg = ""; +# +# foreach my $i (0..7) { +# $startsum += $rStat->{3}->[$i+0x8] ; +# } # $spillsum += $startsum; - -###################################### -## QA check for spill sum on Start - if ($lastspillsum < 0 || $lastspillsum > 20E8) { - $qastatstart = QA::WARN; - } -###################################### - if($outofspill && !$lastoutofspill ) { - $lastspillsum = $spillsum; - HPlot::PlotAdd("StartCountSpills",$spillsum/1E6); - HPlot::PlotDraw("StartCountSpills"); - $spillsum = 0; - } - $startmsg = sprintf("%s / %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); - $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); - QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); - - +# +# # $startsum = $rStat->{3}->[0x29]; +# # $spillsum += $startsum; +# +# ###################################### +# ## QA check for spill sum on Start +# if ($lastspillsum < 0 || $lastspillsum > 20E8) { +# $qastatstart = QA::WARN; +# } +# ###################################### +# if($outofspill && !$lastoutofspill ) { +# $lastspillsum = $spillsum; +# HPlot::PlotAdd("StartCountSpills",$spillsum/1E6); +# HPlot::PlotDraw("StartCountSpills"); +# $spillsum = 0; +# } +# $startmsg = sprintf("%s / %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); +# $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); +# QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); +# +# if ($lastlongmsg ne $longmsgcheck && $longmsg ne "") { diff --git a/hmon/hmon_triggerratio.pl b/hmon/hmon_triggerratio.pl index 2e74321..134869f 100755 --- a/hmon/hmon_triggerratio.pl +++ b/hmon/hmon_triggerratio.pl @@ -13,7 +13,8 @@ use List::Util qw[min max sum]; my $STARTRATELIMIT = 50000; my $UPPERLIMIT = 0.03; -my $oldtb; +my $UPPERLIMIT_PT3 = 0.004; +my $oldtb; my $oldst; my $diff; my $iter = 0; my $vdiff; @@ -38,6 +39,26 @@ HPlot::PlotInit({ storable => 1, }); +HPlot::PlotInit({ + name => "Pt3StartRatio", + file => "files/Pt3StartRatio", + entries => 1000, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Time", + ylabel => "Ratio", + sizex => 950, + sizey => 330, + ymin => -0.001, + ymax => "$UPPERLIMIT_PT3"."1", + xscale => 5, + curves => 2, + buffer => 1, + nokey => 1, + dots => 1, + storable => 1, + }); + HPlot::PlotInit({ name => "M2Rate", file => "files/M2Rate", @@ -57,23 +78,56 @@ HPlot::PlotInit({ # dots => 1, storable => 1, }); + -my $str = Hmon::MakeTitle(12, 7, "M2 / Start Ratio",0); +HPlot::PlotInit({ + name => "StartCountSpills", + file => "files/StartCountSpills", + entries => 100, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Spill Number", + ylabel => "Start Counts per Spill [Mcnt]", + sizex => 630, + sizey => 220, + nokey => 1, + buffer => 1, + storable => 1, + }); + +my $str = Hmon::MakeTitle(8,5,"Start X Counts per Spill (millions)",0); + $str .= qq@@; + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("StartCountSpill",$str); + + + $str = Hmon::MakeTitle(12, 7, "M2 / Start Ratio",0); $str .= qq@
\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("M2StartRatio",$str); - + + $str = Hmon::MakeTitle(12, 7, "PT3 / Start Ratio",0); + $str .= qq@
\n@; + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("Pt3StartRatio",$str); + $str = Hmon::MakeTitle(12, 7, "M2 Rate",0); $str .= qq@
\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("M2Rate",$str); trb_init_ports() or die trb_strerror(); +my $fqa = QA::OpenQAFile(); + +my $spillsumstart = 0; +my $lastinspill = 0; +my $lastspillsumstart = 0; while (1) { my $tb = trb_registertime_read_mem(0x10,0x9000,0,224); - + my $st = trb_registertime_read_mem(0xfe76,0xdfc0,0,24); + my $inspill = $tb->{0x10}{value}[0x5d] >> 31; if (defined $oldtb) { @@ -82,16 +136,30 @@ while (1) { $tdiff += 2**16 if ($tdiff <= 0); $tdiff = ($tdiff * 16 / 1E6) || 1; for my $v (0..223) { - $vdiff = ($tb->{$b}{value}[$v]&0xffffff) - ($oldtb->{$b}{value}[$v]&0xffffff); + $vdiff = (($tb->{$b}{value}[$v]||0)&0xffffff) - (($oldtb->{$b}{value}[$v]||0)&0xffffff); $vdiff += 2**24 if ($vdiff < 0); $diff->{$b}->[$v] = $vdiff/$tdiff; } } - + foreach my $b (keys %$st) { + next if ($b < 0x5000 || $b > 0x5003); + my $tdiff = $st->{$b}{time}[0] - ($oldst->{$b}{time}[0]||0); + $tdiff += 2**16 if ($tdiff <= 0); + $tdiff = ($tdiff * 16 / 1E6) || 1; + for my $v (0..23) { + $vdiff = (($st->{$b}{value}[$v]||0)&0xffffff) - (($oldst->{$b}{value}[$v]||0)&0xffffff); + $vdiff += 2**24 if ($vdiff < 0); + $diff->{$b}->[$v] = $vdiff/$tdiff; + } + } + my $startdirect = sum(@{$diff->{0x5000}},@{$diff->{0x5001}},@{$diff->{0x5002}},@{$diff->{0x5003}}); my $start = sum(@{$diff->{0x10}}[56..63]) + sum(@{$diff->{0x10}}[72..79]); #sum from start my $m2 = $diff->{0x10}[0x50]; - + my $pt3 = $diff->{0x10}[218]; + +# print $startdirect." ".$start."\n"; +###Ratio M2 over Start my $ratio = $m2/($start||1); if ($start <= $STARTRATELIMIT || !$inspill) { HPlot::PlotAdd("M2StartRatio",0,1); @@ -101,35 +169,76 @@ while (1) { HPlot::PlotAdd("M2StartRatio",$UPPERLIMIT,1); HPlot::PlotAdd("M2StartRatio","NaN",0) } - else { HPlot::PlotAdd("M2StartRatio","NaN",1); HPlot::PlotAdd("M2StartRatio",$ratio,0) } - + +###Ratio PT3 over Start + $ratio = $pt3/($start||1); + if ($start <= $STARTRATELIMIT || !$inspill) { + HPlot::PlotAdd("Pt3StartRatio",0,1); + HPlot::PlotAdd("Pt3StartRatio","NaN",0) + } + elsif ($ratio >= $UPPERLIMIT_PT3) { + HPlot::PlotAdd("Pt3StartRatio",$UPPERLIMIT_PT3,1); + HPlot::PlotAdd("Pt3StartRatio","NaN",0) + } + else { + HPlot::PlotAdd("Pt3StartRatio","NaN",1); + HPlot::PlotAdd("Pt3StartRatio",$ratio,0) + } + +###M2 Rate if (!$inspill) { HPlot::PlotAdd("M2Rate",0,1); HPlot::PlotAdd("M2Rate","NaN",0) } -# elsif ($ratio >= $UPPERLIMIT) { -# HPlot::PlotAdd("M2StartRatio",$UPPERLIMIT,1); -# HPlot::PlotAdd("M2StartRatio","NaN",0) -# } else { HPlot::PlotAdd("M2Rate","NaN",1); HPlot::PlotAdd("M2Rate",$m2,0) } - if($iter++ == 5){ + if($iter == 4){ HPlot::PlotDrawFork("M2StartRatio"); + HPlot::PlotDrawFork("Pt3StartRatio"); HPlot::PlotDrawFork("M2Rate"); - $iter = 0; } + +###Spill Sum from Start + if(!$inspill && $lastinspill) { + $lastspillsumstart = $spillsumstart / 5; #DIVIDED BY 200ms period! + $spillsumstart = 0; + HPlot::PlotAdd("StartCountSpills",$lastspillsumstart/1E6); + HPlot::PlotDrawFork("StartCountSpills"); + } + if($inspill) { + $spillsumstart += $start; + } + + if($iter==5) { + my $qastatstart = QA::OK; + my $startmsg = ""; + my $startlongmsg = ""; + if ($lastspillsumstart < 10000 || $lastspillsumstart > 20E8) { + $qastatstart = QA::WARN; + } + $startmsg = sprintf("%s / %s",QA::SciNotation($start),QA::SciNotation($lastspillsumstart)); + $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($start),QA::SciNotation($lastspillsumstart)); + QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); + } + + } $oldtb = $tb; + $oldst = $st; + $lastinspill = $inspill; + $iter++; + $iter = 0 if $iter == 6; + print time()."\n"; usleep(200000); } diff --git a/hmon/index.cgi b/hmon/index.cgi index 4169801..c1f0d79 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -34,7 +34,7 @@ function openwin(url) {
  • Web Tools (daqtools)
  • Eventbuilder Monitor
  • Raw Data Monitor
  • -
  • Accumulated Run Statistics +
  • Accumulated Run Statistics
  • / && $cnt == 2) { $date = stripped($line); $found++;} + if ($line =~ /^{$date}==1) { + + $store->{$date} = 1; + + if (!$firstrun) { + my $cmd = "pandoc --from html --to markdown_strict"; + run3($cmd, \$text, \@ret); + + my $string = "[$topic] **$user** ($date)\n"; + $string .= join('',@ret); + print $string; + + $hash->{text} = $string; + $string = encode_json($hash); + + my $ua = LWP::UserAgent->new(); + my $req = new HTTP::Request( + 'POST' => "https://coop.gsi.de/mm/hooks/85pmt5r7ypf9ibujt8keyjf3xh", + ['Content-Type' => 'application/json'], + $string + ); + print Dumper $ua->request($req); + +# exit; + } + } + $found = 0 if $found == 5; + $cnt++; + } + $firstrun=0; + sleep 60; + } + +sub stripped { + my $str = $_[0]; + $str =~ s!^!!; + $str =~ s!^!!; + $str =~ s!
    "; - my $cmd = "ls -rt /home/hadaq/trbsoft/daq/hmon/vertex/target_*.jpg | tail -n 5"; + my $cmd = "ls -rt /home/hadaq/trbsoft/daq/hmon/vertex/target_*.gif | tail -n 5"; my @files = qx($cmd); @files = reverse @files; - $cmd = "ls -rt /home/hadaq/trbsoft/daq/hmon/vertex/targetSum*.jpg | tail -n 5"; + $cmd = "ls -rt /home/hadaq/trbsoft/daq/hmon/vertex/targetSum*.gif | tail -n 5"; my @files2 = qx($cmd); @files2 = reverse @files2;