$entries->{'main'} = ['time', 'rate','beamabort','up','spillcount'];
$entries->{'daq'} = ['trbnet', 'timeouts', 'busy','readout','outofsync'];
$entries->{'trg'} = ['spill', 'accepted', 'source','pt1rate', 'start'];
-$entries->{'rate'} = ['pt1','pt2','pt3','','pt8'];
-$entries->{'server'} = ['fill', 'cpu', 'ip', 'ebinputs', 'onlineqa']; #icinga, pwrsup
+$entries->{'rate'} = ['pt1','pt2','pt3','pt8','veto'];
+$entries->{'server'} = ['fill', 'cpu', '', 'ebinputs', 'onlineqa']; #icinga, pwrsup
$entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits'];
$entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage'];
$entries->{'endp'} = ['mdc','rich', 'tof', 'rpc', 'other'];
our @TrgErrLimits = (100, 1000, 10000);
our @CPULimits = (95, 100, 100);
our @TimeoutLimits = (0, 0, 1);
-our @TimeoutLimitsOnlyRICHMDC = (1, 5, 10);
+our @TimeoutLimitsOnlyRICHMDC = (4, 6, 10);
our @LinkErrLimits = (50, 500, 1000);
our @MdcEndpMissingLimits = (4, 5, 6); #(0, 4, 5)!!! Oh dear.
-our @RichEndpMissingLimits = (0, 3, 4);
+our @RichEndpMissingLimits = (1, 3, 4);
our @TofEndpMissingLimits = (0, 0, 0);
our @RpcEndpMissingLimits = (0, 0, 0);
our @OtherEndpMissingLimits = (0, 0, 0);
our @PadiwaHodoLimits = (0, 0, 0);
our @LimitTriggerPerSpill = (1000, 0, 0);
-our $AcceleratorCycle = 9;
+our $AcceleratorCycle = 20;
use constant {CTSAddress => 0x0003};
###############################################################################
# Missing Boards
###############################################################################
-our @mdc_boards_removed =(0x2203);#(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23
+our @mdc_boards_removed =(); # 2333 added 2024-03-01 #(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23
our @mdc_chambers_removed =();
our @rich_boards_removed =();#(0x71a4,0x71a5,0x71b4,0x71b5,0x72a4,0x72a5,0x72b4,0x72b5,0x73a4,0x73a5,0x73b4,0x73b5,0x826a);
our @tof_boards_removed =();
}
}
+# Tries to nicely format an integer
+sub SciNotation2 {
+ my $v = shift;
+ return "undef" if (!defined $v);
+ return "0" if $v == 0;
+# print $v."\n";
+ if(abs($v) >= 1) {
+ return sprintf("%.1f", $v) if (abs($v) < 10) ;
+ return sprintf("%i", $v) if (abs($v) < 1000) ;
+ return sprintf("%.1f×10<sup>3</sup>", $v / 1000.) if (abs($v) < 20000) ;
+ return sprintf("%i×10<sup>3</sup>", $v / 1000.) if (abs($v) < 1E6) ;
+ return sprintf("%.1f×10<sup>6</sup>", $v / 1000000.) if (abs($v) < 20E6) ;
+ return sprintf("%i×10<sup>6</sup>", $v / 1000000.) if (abs($v) < 1E9) ;
+ return sprintf("%.2f×10<sup>9</sup>", $v / 1E9) if (abs($v) < 20E9) ;
+ return sprintf("%.1f×10<sup>9</sup>", $v / 1E9) if (abs($v) < 100E9) ;
+ return sprintf("%i",$v);
+ }
+ else {
+ return sprintf("%i×10<sup>-9</sup>", $v*1E9) if (abs($v) < 1E-6) ;
+ return sprintf("%i×10<sup>-6</sup>", $v*1E6) if (abs($v) < 1E-3) ;
+ return sprintf("%.1f×10<sup>-3</sup>", $v*1E3);
+ }
+}
+
############################################
# A simple date string
sub getTimeString {
<p>In case of an error wait for the next update after ~ 30 seconds. Especially if a value reads back with a value of 0 it's likely not an error on the magnet but with getting the information from EPICS.
<h4>Error Handling in case it is not <font color="gree">Green</font> for > 2 min.</h4>
-<p>Call <b>Torsten Heinz</b> (mobile: 0175 388 4066 or home: 06162 982292 or work: 1818<br>
+<p>Call <b>Torsten Heinz</b> (mobile: 0176 579 39435 or home: 06162 982292 or work: 1818<br>
<h4>Error Handling</h4>
+There's no need to react immediately, but some steps should be taken whenever the next
+DAQ restart is needed.
+Doing so before an actual failure of a board is always simpler and quicker.
-The full message contains the addresses of affected boards - consider rebooting the
-coresponding subsystem at your convenience. Doing so before an actual failure of
-the board is always simpler and quicker.
+<p>Suggestion: Use reboot "Quite-a-lot" first, and then see if any reported errors remain.
+<p>The full message contains the addresses of affected boards - consider rebooting the
+coresponding subsystem at your convenience.
-<br>If many RICH Combiner boards show up, do a reboot RICH and reboot RICH combiners before the next DAQ restart.
+<h3>TDC Monitoring</h3>
+Checks the correct order of data words in TDCs. This sometimes can get corrupted with the "wrong" kind of noise from the detector.
+
+<h4>Error Handling</h4>
+Problems in ECal should be automatically corrected within one minute.<br>
+For other subsystems, check if there is noise in the reported channels, discuss with detector experts.
+<p>If the problem does not vanish, try a reboot of the sub-system with the next DAQ restart. Few errors are acceptable and don't need immediate action.
+
+++ /dev/null
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-use Data::Dumper;
-use HADES::TrbNet;
-use List::Util qw[min max];
-use Email::Sender::Simple qw(sendmail);
-use Email::Simple;
-use Email::Simple::Creator;
-
-use Log::Log4perl qw(get_logger);
-
-################################
-# To disable script: just uncomment
-# the following line with "exit"
-################################
-exit;
-################################
-
-
-my $HADESDAQ="/home/hadaq/trbsoft/hadesdaq/";
-
-Log::Log4perl::init($HADESDAQ . "hmon/automatic_restart_logger.conf");
-my $logger = get_logger("automatic_restart");
-
-$logger->info("startup");
-
-print STDERR "restarted. The log file is here:
-/home/hadaq/trbsoft/hadesdaq/hmon/logs/automatic_restart.log
-";
-
-trb_init_ports() or die trb_strerror();
-
-my $mail_fn = $HADESDAQ . "main/alarm_mail_list.txt";
-
-my $number_of_reset_retries = 4;
-
-my $num_of_entries = 10; # loop 10 times and build average
-
-# number of MDC OEPs which are allowed to be misssing before alarm
-my $max_allowed_mdc_oeps_missing = 1;
-
-# minimal average DAQ rate allowed before an alarm
-my $lower_rate_limit = 150;
-my $upper_rate_limit = 450;
-
-
-my $beep_intervall = 10;
-my $mail_intervall = 600;
-
-my $rh_data = {};
-
-my $fh;
-
-open ($fh, "<", "/tmp/mdc_number_missing_boards") || die "could not open /tmp/mdc_number_missing_boards";
-$fh->autoflush(1);
-
-
-my $time_last_beep_alarm=0;
-my $time_last_mail_alarm=0;
-
-my $CURRENT_STATE = "idle";
-my $NEXT_STATE = "idle";
-my $reset_counter = 0;
-my $iterator = 0;
-while (1) {
-
- STATE_SWITCH:
- for ($CURRENT_STATE) {
- if (/idle/) {
- last STATE_SWITCH;
- }
- if (/error/) {
- last STATE_SWITCH;
- }
- if (/reset/) {
- if ($reset_counter < $number_of_reset_retries
- && $iterator >= $num_of_entries) {
- $reset_counter++;
- $logger->debug("doing a reset now: number of resets: $reset_counter");
- my $c = q|echo "<div style='position:absolute;top:5px;left:15px;color:red;font-weight:bold;z-index:100'>Doing an automatic TrbNet reset</div>" > ~/trbsoft/hadesdaq/hmon/files/note.htt; ssh lxhadesdaqp 'cd ~/trbsoft/daq/main; ./startup_briccolage.sh dont_restart_monitoring'; rm ~/trbsoft/hadesdaq/hmon/files/note.htt|;
- #print STDERR localtime() . ": command: $c\n";
- qx($c);
- $c=q|ssh lxhadesdaqp '/usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt "http://lxhadeb12:8099/Master/BNET/StartRun/execute?prefix=co&oninit=10"'|;
- #print STDERR localtime() . ": command: $c\n";
- qx($c);
- $iterator = 0;
- @{$rh_data->{'rates'}} =();
- last STATE_SWITCH;
- }
- }
- }
-
- my $daq_rate;
-
- my $rh_rate = trb_register_read(0x0003, 0xa001) or sleep 5 and next;
-
- if ( !defined $rh_rate) {
- $daq_rate = 0;
- }
- else {
- $daq_rate = $rh_rate->{0x0003} & 0xfffff; # only 20bits
- }
-
- #print STDERR "daq_rate: $daq_rate\n";
- push(@{$rh_data->{'rates'}}, $daq_rate);
- $iterator++;
- my $num_datapoints = scalar @{$rh_data->{'rates'}};
- #print STDERR "iterator: $iterator: num_data_points: $num_datapoints\n";
- if ($iterator >= $num_of_entries) {
- shift @{$rh_data->{'rates'}};
- }
-
- my $sum = 0;
- foreach (@{$rh_data->{'rates'}}) {
- $sum += $_;
- }
- my $average_rate = $sum / $num_of_entries;
- #print STDERR "average_rate: $average_rate\n";
- seek($fh, 0, 0);
- my $num_mdc_missing = <$fh>;
- chomp $num_mdc_missing;
-
- my $state_string = "num missing: $num_mdc_missing , average_rate: $average_rate";
- #print "state_string: $state\n";
-
- if($iterator >= $num_of_entries ) {
- # ($average_rate > $upper_rate_limit) ||
- if ( ($average_rate < $lower_rate_limit) ||
- ($num_mdc_missing > $max_allowed_mdc_oeps_missing) ) {
- my $time = time();
- $logger->debug("going to state in_error: average_rate: $average_rate, mdc_missing: $num_mdc_missing, iterator: $iterator\n");
- $NEXT_STATE = "reset";
- if ($time - $time_last_beep_alarm > $beep_intervall) {
- $time_last_beep_alarm=$time;
- $logger->debug("beep: state: $state_string");
- my $c;
- $c = q|ssh -X hadesp30 'DISPLAY=:1 xterm -iconic -e bash -c "~/bin/bell;"' &|;
- print "command: $c\n";
- qx($c);
-
- $c = "mpv --audio-device=auto ~/Documents/foghorn-daniel_simon.mp3 >/dev/null 2>/dev/null </dev/null &";
- qx($c);
- }
-
-
- if ( ($time - $time_last_mail_alarm) > $mail_intervall && $reset_counter >= $number_of_reset_retries) {
-
- $time_last_mail_alarm = $time;
-
- my $mail_fh;
- open ($mail_fh, "<", "$mail_fn") || print "could not open file: $mail_fn\n";
-
- my @mails = <$mail_fh>;
- $mail_fh->close;
- chomp @mails;
- foreach my $cur_mail (@mails) {
-
- next if($cur_mail=~/^#/ || $cur_mail=~/^\s+/ || $cur_mail=~/^\n/);
- next unless $cur_mail=~/\w+@\w+/;
- $logger->debug("current mail sent to: $cur_mail" );
- my $reset_counter_str = $reset_counter;
- my $email = Email::Simple->create(
- header => [
- To => "$cur_mail",
- From => '"HADES DAQ" <hades33@gsi.de>',
- Subject => 'Alarm during cosmic data-taking',
- ],
- body => "Error Condition:
-- MDC-missing-OEPs: $num_mdc_missing
-- average DAQ-rate: $average_rate
- - lower_limit: $lower_rate_limit: upper_limit: $upper_rate_limit
- - if it is outside the limits it might be due to some issue in the RPC.
-- number of resets already tried: $reset_counter_str
-",
- );
-
- sendmail($email) or $logger->error("error sending mail to $cur_mail");
-
- } # loop over mail addresses
-
- } # if mail intervall
-
- } # error condition
- else {
- if($CURRENT_STATE eq "reset") {
- $NEXT_STATE = "idle";
- $reset_counter=0;
- $iterator = 0;
- @{$rh_data->{'rates'}} =();
- $logger->info("leaving error state after $reset_counter number of resets: state: $state_string");
- }
- }
-
-
- if($iterator%60==0) {
- $logger->debug("still alive signal: $state_string, state: $CURRENT_STATE, iterator: $iterator");
- }
-
- } # only if iterator is large enough make error meesages.
-
- sleep 1;
- $CURRENT_STATE = $NEXT_STATE;
-} #endless loop
-
-
-
$qastate = QA::GetQAState('below',$num_rich_missing,@QA::RichEndpMissingLimits);
- $qastate = QA::NOTE if $num_rich_missing > 900;
+# $qastate = QA::NOTE if $num_rich_missing > 900;
if($qastate > 60) {
system("logger -p local1.info -t DAQ Endp \\<E\\> $rich_longtext") unless (($timecnt->{rich}++)%$loggerperiod);
}
my @y = (0,
16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,12,12,12,12,12,12,12,12,12,12,14,14,14,14,14,14,14,14,14,14,16,16,16,16,18,18,18,18,20,20,20,20,22,22,22,22,24,24,24,24,26,26,26,26,28,28,28,28,28,28,28,28,28,28,30,30,30,30,30,30,30,30,30,30,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,12,12,12,12,12,12,16,16,16,16,16,16,20,20,20,20,20,20,24,24,24,24,24,24,28,28,28,28,28,28,32,32,32,32,32,32,32,32,32,32,32,36,36,36,36,36,36,36,36,36,36,36,40,40,40,40,40,40,40,40,40);
-my @bo = (0,0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6723, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6723, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6700, 0x6723, 0x6700, 0x6700, 0x6700, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6723, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6720, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6701, 0x6702, 0x0000, 0x0000, 0x6702, 0x6720, 0x6702, 0x6723, 0x6723, 0x6723, 0x6723, 0x6702, 0x6702, 0x6702, 0x0000, 0x0000, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6702, 0x6703, 0x6703, 0x6703, 0x6703, 0x6722, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6703, 0x6723, 0x6723, 0x6723, 0x6723, 0x6703, 0x6703, 0x6703, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6723, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6710, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6711, 0x6712, 0x6712, 0x6712, 0x6712, 0x6723, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x0000, 0x0000, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x0000, 0x0000, 0x0000, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x6712, 0x0000, 0x6712, 0x6712, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6713, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x6720, 0x0000, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x0000, 0x0000, 0x0000, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x6722, 0x0000, 0x0000);
+my @bo = (0,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6723,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6723,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6700,0x6723,0x6700,0x6700,0x6700,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6723,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6720,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6701,0x6702,0x0000,0x0000,0x6702,0x6720,0x6702,0x6723,0x6723,0x6723,0x6723,0x6702,0x6702,0x6702,0x0000,0x0000,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6702,0x6703,0x6703,0x6703,0x6703,0x6722,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6703,0x6723,0x6723,0x6723,0x6723,0x6703,0x6703,0x6703,0x6710,0x6710,0x6710,0x6710,0x6710,0x6723,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6710,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6711,0x6712,0x6712,0x6712,0x6712,0x6723,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x0000,0x0000,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x0000,0x0000,0x0000,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x6712,0x0000,0x6712,0x6712,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6713,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x6720,0x0000,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x0000,0x0000,0x0000,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x6722,0x0000,0x0000);
-my @ch = (0,2,3,4,5,6,7,8,9,10,26,12,13,14,15,16,17,18,19,20,30,22,23,24,25,26,27,28,28,30,31,32,1,2,3,4,5,6,27,8,9,10,11,12,13,14,15,16,24,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,0,0,2,31,4,29,13,14,15,9,10,11,0,0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,16,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,9,10,11,12,30,31,32,1,2,3,4,5,31,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,32,6,7,8,9,10,11,12,13,14,0,0,15,16,17,18,19,20,21,0,0,0,22,23,24,25,26,27,28,29,30,0,31,32,1,2,3,4,5,6,8,10,11,13,14,15,17,18,19,20,21,22,17,18,19,20,21,22,23,24,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,0,1,2,3,4,5,6,7,8,9,0,0,0,10,11,12,13,14,15,32,0,0);
+my @ch = (0,1,2,3,4,5,6,7,8,9,10,26,12,13,14,15,16,17,18,19,20,30,22,23,24,25,26,27,28,28,30,31,32,1,2,3,4,5,6,27,8,9,10,11,12,13,14,15,16,24,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,0,0,2,31,4,29,13,14,15,9,10,11,0,0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,16,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,9,10,11,12,30,31,32,1,2,3,4,5,31,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,32,6,7,8,9,10,11,12,13,14,0,0,15,16,17,18,19,20,21,0,0,0,22,23,24,25,26,27,28,29,30,0,31,32,1,2,3,4,5,6,8,10,11,13,14,15,17,18,19,20,21,22,17,18,19,20,21,22,23,24,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,0,1,2,3,4,5,6,7,8,9,0,0,0,10,11,12,13,14,15,32,0,0);
HPlot::PlotInit({
name => "FwRate",
my $o = trb_register_read_mem(0xfe47,0xdfc0,0,32) or die trb_strerror() or sleep 5 and next;
if (defined $old) {
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
foreach my $b (keys %$o) {
#my $ratesum = 0;
next unless ($b>=0x6700 && $b<=0x67ff);
for my $v (0..31) {
- my $vdiff = ($o->{$b}->[$v]&0xfffffff) - ($old->{$b}->[$v]&0xfffffff);
+ my $vdiff = ($o->{$b}->[$v]&0xffffff) - ($old->{$b}->[$v]&0xffffff);
- if ($vdiff < 0) { $vdiff += 2**28;}
+ if ($vdiff < 0) { $vdiff += 2**24;}
$diff->{$b}->[$v] = $vdiff/$tdiff;
HPlot::PlotFill('FwRateSimple',$diff->{$b}->[$v],$v,($b%4)+((($b>>4)%4)*4-($b>=0x6722?1:0)));
if($err) {
$errorcnt++;
$longstatus .= "Hub $b ($det) not reached<br>";
-# print $longstatus."\n";
+ print $longstatus."\n";
$qastate = QA::ERROR;
}
}
#my $min = 5E9;
my $o = trb_register_read_mem(0xfe74,0xdfc0,0,48) or die trb_strerror() or sleep 5 and next;
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
if (defined $old) {
foreach my $board (keys %$o) {
$cnt--;
$msg .= "->AR";
$cnt2++;
+ system("logger -p local1.info -t DAQ 'RICH <I> Re-Included DiRich to DAQ: $msg'");
}
}
}
my $o = trb_register_read_mem(0xfe51,0xc000,0,33) or die trb_strerror() or sleep 5 and next;
if (defined $old) {
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
foreach my $b (keys %$o) {
#my $ratesum = 0;
my $sec = ($b>>1) & 0x3;
my $o = trb_register_read_mem(0xfe73,0xdfc0,0,48) or die trb_strerror() or sleep 5 and next;
if (defined $old) {
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
foreach my $b (keys %$o) {
#my $ratesum = 0;
next unless ($b>=0x5800 && $b<=0x58ff);
sizex => 950,
sizey => 330,
xmin => 0,
- curvewidth => .9,
- xmax => 2000,
+ ymin => 0,
+ curvewidth => .9,
+ xmax => 2000,
# nokey => 1,
buffer => 1,
- storable=> 1
+# storable=> 1
}
- );
+ );
my $str = Hmon::MakeTitle(12,7,"RpcTofSectorRate_highres",0);
$str .= qq@<img src="%ADDPNG files/RpcTofSectorRateHist_highres.png%" type="image/png">@;
while (1) {
$iter++;
-
+
my $rpc = trb_registertime_read(0xfe61,0xdfe6);
my $tof = trb_registertime_read(0xfe40,0xdfd3);
$vdiff += 2**24 if ($vdiff < 0);
$diff->{$b} = $vdiff/$tdiff;
if ($b >= 0x84c0 && $b <= 0x84c5) {
+ #print Dumper $diff->{$b}, $b&0xF;
HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff->{$b},$b&0xF);
+ #HPlot::PlotAdd( 'RpcTofSectorRateHist', 100);
}
}
foreach my $b (keys %$tof) {
$vdiff += 2**24 if ($vdiff < 0);
$diff->{$b} = $vdiff/$tdiff;
if ($b >= 0x86c0 && $b <= 0x86c5) {
+ #print Dumper $diff->{$b}, ($b&0xF)+6;
HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff->{$b},($b&0xF)+6);
}
}
$oldtof = $tof;
HPlot::PlotDrawFork('RpcTofSectorRateHist') if $iter == 10;
+ #HPlot::PlotDrawFork('RpcTofSectorRateHist');
$iter = 0 if $iter == 10;
usleep(100000);
}
$longtext = "$seuboards out of $totalboards monitored report some radiation issues<br>";
$longtext .= sprintf("%04x (%s)<br>",$_,Hmon::getsystem($_)) for sort @boards;
- if($seuboards >= 12) {
+ if($seuboards >= 8) {
+ $longtext .= "<br>Quite many boards seem to be affected by radiation. It's suggested to reboot \"Quite-a-lot\" before the next DAQ restart.";
$qastate = QA::WARN;
}
if($seuboards >= 16) {
my $qashort;
my $qalong;
-
if (!$spillsignal && $lastspillsignal) {
$spillcount++;
$qashort, $qalong) unless $opt_debug>0;
HPlot::PlotAdd("EvtsPerSpill",$events/1E3) unless $opt_debug>0;
HPlot::PlotDraw("EvtsPerSpill") unless $opt_debug>0;
- $events = 0;
+ if(($events < $QA::LimitTriggerPerSpill[0] && $qastate > QA::OK)) {
+ my $prefix = get ($url_prefix);
+ Hmon::Speak('nobeam', "No beam") if ($prefix =~ 'be');
+ }
+
+
+ $events = 0;
$spilllength = 0;
} elsif ($spilllength > 30) {
QA::WriteQALog($fqa, "trg", "spill", 30, QA::NOTE, "Spill Sum",
$qashort, $qalong) unless $opt_debug>0;
}
my $spillcountstate = QA::OK;
- if ($countnochange > 50) {
+ if ($countnochange > $QA::AcceleratorCycle * 4) { #double normal duration
$spillcountstate = QA::WARN;
# my $prefix = get ($url_prefix);
# $prefix = "--" unless defined $prefix;
#print Dumper $o;
if (defined $old) {
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
foreach my $endpoint (sort keys %$current) {
#foreach my $endpoint (0x5000, 0x5001, 0x5002, 0x5003, 0x5004) {
#my $ratesum = 0;
$qastate = QA::GetQAState('below', $cnt+$cnt2, @QA::TimeoutLimitsOnlyRICHMDC);
}
- if($boardlist1 ne "") {
+ if($boardlist1 ne "" && $qastate > QA::NOTE) {
Hmon::Speak('timeout'.(($qastate<QA::ERROR)?'once':''),"$cnt Frontend had a timeout: $boardlist1 ") if $cnt < 3;
Hmon::Speak('timeout',"$cnt Frontends had a timeout ") if $cnt >= 3;
}
- if($boardlist2 ne "" && $boardlist1 eq "" ) {
+ if($boardlist2 ne "" && $boardlist1 eq "" && $qastate > QA::NOTE) {
Hmon::Speak("timeout".(($qastate<QA::ERROR)?'once':''),"$cnt2 Frontend disabled after a timeout: $boardlist2") if $cnt2 < 3;
Hmon::Speak('timeout',"$cnt2 Frontends had a timeout ") if $cnt2 >= 3;
}
my $o = trb_register_read_mem(0xfe47,0xdfc0,0,32) or die trb_strerror() or sleep 5 and next;
if (defined $old) {
- my $tdiff = (time() - $oldtime)|1;
+ my $tdiff = (time() - $oldtime)||1;
foreach my $b (keys %$o) {
#my $ratesum = 0;
next unless ($b>=0x5c00 && $b<=0x5cff);
showvalues => 0,
});
+HPlot::PlotInit({
+ name => "Veto_histbar",
+ file => "files/Veto_histbar",
+ entries => 200,
+ type => HPlot::TYPE_BARGRAPH,
+ output => HPlot::OUT_PNG,
+# titles => ["0","1","2","3","4","5","6","7","8","9","10","11"],
+ xlabel => "Time / 1 s",
+ ylabel => "Hitrate [Hz]",
+ sizex => 950,
+ sizey => 330,
+ xmin => 0,
+ xmax => 200,
+ ymin => "0",
+ ymax => "100<*",
+ curves => 8,
+# xscale => 10, # xscale does not work with TYPE_BARGRAPH
+ buffer => 1,
+ stacked => 1,
+ curvewidth => .9,
+# additional => "
+# set obj 1 rect from -1, 7E7 to 2000, 10E7 fc rgb '#ffffbb' behind \n
+# set obj 2 rect from -1, 10E7 to 2000, 100E7 fc rgb '#ffdddd' behind
+# "
+ });
+
my $str = Hmon::MakeTitle(4, 6, "Veto Hit Rate",0);
$str .= qq@<img src="%ADDPNG files/VetoMap.png%" type="image/png"><br>\n@;
$str .= Hmon::MakeFooter();
Hmon::WriteFile("VetoMap",$str);
+$str = Hmon::MakeTitle(12, 7, "Veto Summed Rates",0);
+$str .= qq@<img src="%ADDPNG files/Veto_histbar.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("Veto_histbar",$str);
+
+
my $old;
my $oldtime = time();
my $time = time();
my $iter = 0;
+my $flog = QA::OpenQAFile();
trb_init_ports() or die trb_strerror();
while(1) {
-
+ my $vetosum = 0;
my $o = trb_register_read_mem(0x5004,0xc000,0,9) or die trb_strerror() or sleep 5 and next;
if ($vdiff < 0) { $vdiff += 2**24;}
my $d = $vdiff/$tdiff;
-
+
+ HPlot::PlotAdd('Veto_histbar',$d,$v);
+ $vetosum += $d;
+
if($v == 1) {
HPlot::PlotFill('VetoMap',$d,3,0);
HPlot::PlotFill('VetoMap',$d,3,1);
}
}
HPlot::PlotDrawFork('VetoMap');
-
-
+ HPlot::PlotDrawFork('Veto_histbar');
- }
+ my $vetomsg = QA::SciNotation($vetosum);
+ my $vetolongmsg = sprintf("counts per second %s/s", QA::SciNotation($vetosum));
+ QA::WriteQALog($flog, "rate", "veto", 30, QA::OK, "Veto", $vetomsg, $vetolongmsg);
+ }
$old = $o;
$oldtime = time();
- sleep 1;
+ usleep(1000000);
}
trb_init_ports() or die trb_strerror();
+
my $channels_x_1 = [
- { pch => 1, tdc => 2, ch => 0}, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
- { pch => 3, tdc => 2, ch => 1}, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
- { pch => 5, tdc => 2, ch => 1}, # pch: physical channel. The thing which will be plotted
- { pch => 7, tdc => 2, ch => 3}, # tdc: tdc number
- { pch => 9, tdc => 2, ch => 4}, # ch: channel in the TDC
- { pch => 11, tdc => 2, ch => 6},
- { pch => 13, tdc => 2, ch => 6},
- { pch => 15, tdc => 2, ch => 7}
+ { pch => 2, tdc => 2, ch => 7}, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
+ { pch => 4, tdc => 2, ch => 6}, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
+ { pch => 6, tdc => 2, ch => 5}, # pch: physical channel. The thing which will be plotted
+ { pch => 8, tdc => 2, ch => 4}, # tdc: tdc number
+ { pch => 10, tdc => 2, ch => 3}, # ch: channel in the TDC
+ { pch => 12, tdc => 2, ch => 2},
+ { pch => 14, tdc => 2, ch => 1},
+ { pch => 16, tdc => 2, ch => 0}
];
my $channels_x_0 = [
- { pch => 2 , tdc => 0, ch => 7 }, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
- { pch => 4 , tdc => 0, ch => 6 }, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
- { pch => 6 , tdc => 0, ch => 6 },
- { pch => 8 , tdc => 0, ch => 4 },
- { pch => 10, tdc => 0, ch => 3 },
- { pch => 12, tdc => 0, ch => 1 },
- { pch => 14, tdc => 0, ch => 1 },
- { pch => 16, tdc => 0, ch => 0 }
+ { pch => 1 , tdc => 0, ch => 0 }, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
+ { pch => 3 , tdc => 0, ch => 1 }, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
+ { pch => 5 , tdc => 0, ch => 2 },
+ { pch => 7 , tdc => 0, ch => 3 },
+ { pch => 9, tdc => 0, ch => 4 },
+ { pch => 11, tdc => 0, ch => 5 },
+ { pch => 13, tdc => 0, ch => 6 },
+ { pch => 15, tdc => 0, ch => 7 }
];
my $channels_y_1 = [
- { pch => 2 , tdc => 3, ch => 7 }, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
- { pch => 4 , tdc => 3, ch => 6 }, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
- { pch => 6 , tdc => 3, ch => 6 },
- { pch => 8 , tdc => 3, ch => 4 },
- { pch => 10, tdc => 3, ch => 3 },
- { pch => 12, tdc => 3, ch => 1 },
- { pch => 14, tdc => 3, ch => 1 },
- { pch => 16, tdc => 3, ch => 0 }
+ { pch => 1 , tdc => 3, ch => 0 }, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
+ { pch => 3 , tdc => 3, ch => 1 }, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
+ { pch => 5 , tdc => 3, ch => 2 },
+ { pch => 7 , tdc => 3, ch => 3 },
+ { pch => 9, tdc => 3, ch => 4 },
+ { pch => 11, tdc => 3, ch => 5 },
+ { pch => 13, tdc => 3, ch => 6 },
+ { pch => 15, tdc => 3, ch => 7 }
];
my $channels_y_0 = [
- { pch => 1, tdc => 1, ch => 0}, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
- { pch => 3, tdc => 1, ch => 1}, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
- { pch => 5, tdc => 1, ch => 1},
- { pch => 7, tdc => 1, ch => 3},
- { pch => 9, tdc => 1, ch => 4},
- { pch => 11, tdc => 1, ch => 6},
- { pch => 13, tdc => 1, ch => 6},
- { pch => 15, tdc => 1, ch => 7}
+ { pch => 2, tdc => 1, ch => 7}, # Int(ch/2) because we read from monitoring register, which counts 0-23 for each TDC.
+ { pch => 4, tdc => 1, ch => 6}, # Take care that the functions copy pasted DO NOT have a "-1" for the channels!
+ { pch => 6, tdc => 1, ch => 5},
+ { pch => 8, tdc => 1, ch => 4},
+ { pch => 10, tdc => 1, ch => 3},
+ { pch => 12, tdc => 1, ch => 2},
+ { pch => 14, tdc => 1, ch => 1},
+ { pch => 16, tdc => 1, ch => 0}
];
+
while (1) {
my $st = trb_registertime_read_mem(0xfe58,0xc001,0,8);
<li><a href="../daqtools/index.pl" target="_blank">Web Tools (daqtools)</a></li>
<li><a href="../eb/?browser=fix" target="_blank">Eventbuilder Monitor</a></li>
<li><a href="../rawmon/" target="_blank">Raw Data Monitor</a></li>
-<li class="outdated"><a href="https://web-docs.gsi.de/~webhades/onlineMon/feb22/hades-online.html" target="_blank">Accumulated Run Statistics</a>
+<li><a href="https://web-docs.gsi.de/~webhades/onlineMon/feb24/hades-online-auau800.html" target="_blank">Accumulated Run Statistics</a>
</ul></div>
<div class="linkbox" style="float:right"><h4>Documents</h4><ul>
<li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection">Beamtime Logbook</a></li>
<li><a href="/mon/monitor.cgi?30-window-ExpertsOnCall" style="color:#d33">Experts on Shift</a></li>
<li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hshiftcrews2.form_select">Shift Plan (Oracle)</a></li>
-<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
+<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
</div>
<div class="linkbox" style="width:730px;"><h4>Operator Monitor - the "must-have" windows</h4><ul>
<!--<li class="outdated"><a href="http://hades63/icingaweb2/dashboard">Icinga Server Monitoring (local access only)</a>-->
<li><a href="/munin">Munin Server Monitoring</a></li>
<li style="width:600px;"><a href="archive/?C=M;O=D">Archive of Hmon Windows (updated every 10 minutes)</a></li>
+<li><a href="http://hadesp33:2222">Access all POWER!</a></li>
</ul></div>
</script>$;
}
$out .= qq$
+<div id='duck'></div>
</body>
</html>
$;
--- /dev/null
+../Perl2Epics2.pm
\ No newline at end of file
$longtext .= "none" if (substr($res[3],3,1) ne "1");
$longtext .= "ABORTED" if (substr($res[3],3,1) eq "1");
- $value = "ABORTED" if $longtext =~ /ABORTED/;
$value = "ABORT" if $longtext =~ /ABORT/ && $value ne "";
+ $value = "ABORTED" if $longtext =~ /ABORTED/;
$value = "inactive" if $longtext =~ /inactive/;
$qastate = QA::WARN if $longtext =~ /inactive/;
$qastate = QA::FATAL if $longtext =~ /ABORT/;
if($qastate >= QA::ERROR && $laststate == QA::OK) {
system("ssh hadaq\@hadesp33 'cd /home/hadaq/trbsoft/daq/hmon; PERL5LIB=. perl ./permanent/hmon_archiver.pl once'");
+ system("logger -p local1.info -t DAQ Abort \\<E\\> Beam abort triggered");
Hmon::Speak('beamabort',"Beam abort. Beam abort.");
}
# with this switch disable qalog and enable printout only JAM
my $opt_debug = 0;
my $speak_counter =0;
+my $noData_counter =0;
my $fqa = QA::OpenQAFile();
}
-
-
-
if (index($masterstate, 'NoData') != -1) {
- $qastate = QA::ERROR;
+ $noData_counter++;
+ if($noData_counter > 5) {
+ $qastate = QA::ERROR;
+ }
+ else {
+ $qastate = QA::NOTE;
+ }
$qamsgshort = "All inputs get no data!";
-
- $qamsg = "All eventbuilder inputs do not get any data. Check DAQ or accelerator!";# if ($opt_debug<1) {
-
+ $qamsg = "All eventbuilder inputs do not get any data. Check DAQ or accelerator!";
}
- if (index($masterstate, 'Mismatch') != -1) {
+ elsif (index($masterstate, 'no_data') != -1) {
+ $qastate = QA::ERROR;
+ my $missingin = substr($masterstate, rindex($masterstate,'_')+1);
+ $qamsgshort = "Input $missingin get no data!";
+ $qamsg = "Eventbuilder input $missingin does not get any data. Try fix missing IP or EB reset.";
+ }
+ elsif (index($masterstate, 'blocked') != -1) {
+ $qastate = QA::ERROR;
+ my $blockedin = substr($masterstate, rindex($masterstate,'_')+1);
+ $qamsgshort = "Input $blockedin get no data!";
+ $qamsg = "Eventbuilder input $blockedin is blocked. Try EB reset.";
+ }
+ elsif (index($masterstate, 'Mismatch') != -1) {
$qamsgshort = "Server mismatch!";
$qastate = QA::ERROR;
$qamsg .= "An eventbuilder server node is missing! Please restart eventbuilders.";
-
- }
+ }
+ else {
+ $noData_counter = 0;
+ }
if ($opt_debug<1) {
- $speak_counter++;
- if($speak_counter>20)
- {
- $speak_counter=-20;
-
- Hmon::Speak('ebmissing',"Event builders are missing input data.") if $qastate > 60;
- }
+ # $speak_counter++ if $qastate > 60;
+ # $speak_counter = 0 if $qastate < 60;
+ # if($speak_counter>10)
+ # {
+ # $speak_counter=-10;
+ Hmon::Speak('ebmissing',"Event builders are missing input data.") if $qastate > 60;
+ # }
# dracones
QA::WriteQALog($fqa, "server", "ebinputs", 10, $qastate, $qatitle,
$qamsgshort, $qamsg);
$evtavglong .= " <br> Number of special triggers is not correct (debug $cnterrtype9 $cnterrtypeE)";
}
if ($totalbytes < 20 && $lasttotalbytes <20) {
- $qastate = QA::WARN_2;
+ $qastate = QA::NOTE;
$speak_counter++;
- if($speak_counter>20)
+ if($speak_counter>10)
{
- $speak_counter=-20;
+ $speak_counter=-10;
+ $qastate = QA::WARN_2;
Hmon::Speak('ebfiles', "Event building not writing files to disk.") unless $opt_debug>0 ||($masterstate =~ /NoNodes/);
print "No files are written by eventbuilders.\n" unless $opt_debug<1;
}
}
+ else {
+ $speak_counter = 0;
+ }
if ($trbneterr == 0) {
my $hour = strftime ("%H", localtime(time+$offset*86400+150));
$hour =~ s/\s//;
- my $plan = get("https://hessenbox-a10.rz.uni-frankfurt.de/dl/fiUP5enanrB2pwwuBDJxGj/ExpertsPlan.csv");
- my @plan = split("\n",$plan);
-
- foreach my $line (@plan) {
- my @s = split(",",$line);
- if (scalar @s == 5 && $s[0] eq 'contact') {
- $store->{contact}{$s[2]}{expert}=$s[1];
- $store->{contact}{$s[2]}{phone}=$s[3];
- $store->{contact}{$s[2]}{alias}=$s[4];
- $store->{alias}{$s[4]} = $s[2];
- $store->{alias}{$s[2]} = $s[4];
- }
- if (scalar @s == 29 && $s[0] ne '') {
- my $exp = $store->{contact}{$s[0]}{expert} //'';
- if($nowmonth eq $s[2] && $nowday eq $s[3]) {
- $store->{onshift}{$exp}{$s[0]} = $s[$hour+4];
- }
- }
- }
+# my $plan = get("https://hessenbox-a10.rz.uni-frankfurt.de/dl/fiUP5enanrB2pwwuBDJxGj/ExpertsPlan.csv");
+# my @plan = split("\n",$plan);
+#
+# foreach my $line (@plan) {
+# my @s = split(",",$line);
+# if (scalar @s == 5 && $s[0] eq 'contact') {
+# $store->{contact}{$s[2]}{expert}=$s[1];
+# $store->{contact}{$s[2]}{phone}=$s[3];
+# $store->{contact}{$s[2]}{alias}=$s[4];
+# $store->{alias}{$s[4]} = $s[2];
+# $store->{alias}{$s[2]} = $s[4];
+# }
+# if (scalar @s == 29 && $s[0] ne '') {
+# my $exp = $store->{contact}{$s[0]}{expert} //'';
+# if($nowmonth eq $s[2] && $nowday eq $s[3]) {
+# $store->{onshift}{$exp}{$s[0]} = $s[$hour+4];
+# }
+# }
+# }
my $oraclecmd = "curl 'https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hshiftcrews2.show_shifts' -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.hshiftcrews2.form_select' -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=$oracledatestart&p_end=$oracledateend&p_purpose_id=&p_responsible=&p_action=Show+Shift+Crew' -u hades:6\\\$ectors 2>/dev/null" ;
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=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 $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=APR24TEST&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;
'HAD:MAGNET:TC1238' => {},#{'min' => 4.6 , 'max' => 4.9 },
'HAD:MAGNET:TC1248' => {},#{'min' => 4.5 , 'max' => 4.7 },
'HAD:MAGNET:FI1400' => {},#{'min' => 0.36 , 'max' => 0.62 },
- 'HAD:MAGNET:PSUI_rbk' => {'min' => 1840 , 'max' => 1860 },
+ 'HAD:MAGNET:MCS:PSUI_rbk' => {'min' => 1840 , 'max' => 1860 },
'HAD:MAGNET:PSUV_rbk' => {},#{'min' => 0 , 'max' => 1 },
'HAD:MAGNET:BBI' => {},#{'min' => 419 , 'max' => 620 },
- 'HAD:MAGNET:LL1708' => {'minerror' => 30, 'min' => 38, 'max' => 65, 'maxerror' => 65},
+ 'HAD:MAGNET:MCS:LL1708' => {'minerror' => 30, 'min' => 38, 'max' => 65, 'maxerror' => 65},
'HAD:MAGNET:TP1240' => {},#{'min' => 75.5 , 'max' => 89.0 , 'cal_max' => 2},
'HAD:MAGNET:PI2610' => {},#{'min' => 1.7 , 'max' => 3.1 },
'HAD:MAGNET:TP2200' => {},#{'min' => 83.0 , 'max' => 85.5 , 'cal_max' => 2},
my $val = $epics->{$name}->{val};
$time = $epics->{$name}->{tme} if ($epics->{$name}->{tme} < $time) or ($time == 0);
# print("$name $val\n");
- if ($name eq 'HAD:MAGNET:PSUI_rbk') {
+ if ($name eq 'HAD:MAGNET:MCS:PSUI_rbk') {
$current = $val;
# print("\t$name $val\n");
}
$TS105 = $val;
# print("\t$name $val\n");
}
- if ($name eq 'HAD:MAGNET:LL1708') {
+ if ($name eq 'HAD:MAGNET:MCS:LL1708') {
$LL1708 = $val;
# print("\t$name $val\n");
}
}
#print $fatal_error_string . "\n";
if ($fatal_error_counter>3) {
- $fatal_error_string .= " (last good check at $last_good_time)";
+ $fatal_error_string .= "\n(last good check at $last_good_time, last check at $time)";
my $state = $magnet_on?(QA::FATAL):(QA::NOTE);
QA::WriteQALog($flog,"misc","magnet",$interval+20,$state,$title,$value,$fatal_error_string);
} elsif ($red_error_counter > 0) {
- $fatal_error_string .= " (last good check at $last_good_time)";
+ $fatal_error_string .= "\n(last good check at $last_good_time, last check at $time)";
my $state = $magnet_on?(QA::ERROR):(QA::NOTE);
QA::WriteQALog($flog,"misc","magnet",$interval+20,$state,$title,$value,$fatal_error_string);
} elsif ($yellow_error_counter > 0) {
- $fatal_error_string .= " (last good check at $last_good_time)";
+ $fatal_error_string .= "\n(last good check at $last_good_time, last check at $time)";
my $state = $magnet_on?(QA::WARN):(QA::NOTE);
QA::WriteQALog($flog,"misc","magnet",$interval+20,$state,$title,$value,$fatal_error_string);
} else {
$longmsg .= "VacHigh HI </br>";
}
if($qastat == QA::OK) {
- $msg = sprintf("%s / %s",QA::SciNotation($vallow),QA::SciNotation($valhigh));
+ $msg = sprintf("%s / %s",QA::SciNotation($vallow),QA::SciNotation2($valhigh));
}
$longmsg .= sprintf("low vacuum: 20 mbar << 25 mbar < <b>%s mbar</b> < 80 mbar << 110 mbar </br>",QA::SciNotation($vallow));
- $longmsg .= sprintf("high vacuum: <b>%s mbar</b> < 60u mbar << 150u mbar </br>",QA::SciNotation($valhigh));
+ $longmsg .= sprintf("high vacuum: <b>%s mbar</b> < 60×10<sup>-6</sup> mbar << 150×10<sup>-6</sup> mbar </br>",QA::SciNotation2($valhigh));
if($H2_run) {
if ($data->{"Gate"}->{tme}==-1) {
}
}
$str .="<div id=\"footer\" class=\"footer\"></div></div>";
+# $str .= '<div id="duck"></div>';
$str .= Hmon::MakeFooter();
Hmon::WriteFile("QA",$str);
my $timer = 0;
my $offset_o2 = 0;
my $str = "";
+#my @emailAddrs = ("juergen.friese\@ph.tum.de", "foertsch\@uni-wuppertal.de", "pauly\@physik.uni-wuppertal.de");
+my @emailAddrs = ();
+my $mailoutWarn = 0;
+my $mailoutErr = 0;
+my $mailoutDaily = 0;
my $s = "HAD:RICH:GAS:pipePressureIsoB";
Perl2Epics::Connect("IsoPress",$s);
Perl2Epics::Connect("IsoScale2","HAD:scale:2:net");
print "Connected.\n";
+usleep 1E6;
+Perl2Epics::GetAll();
while(1) {
my $data = Perl2Epics::GetAll();
$qastate = min(QA::WARN_2,$qastate) if $QA::RichHvOff;
$qastate = QA::NOTE if $QA::RichGasOff;
+ if($qastate == QA::WARN_2 && time()-$mailoutWarn > 60*60) {
+ foreach my $currEmailAddr (@emailAddrs) {
+ my $body = "";
+ $body .= "The RICH gas system warns:\n";
+ $body .= sprintf("Isobutan pressure : %.2f bar Warn(<0.9)\n",$IsobPress);
+ $body .= sprintf("O2 concentration : %.1f ppm Warn(>2000.0)\n",$IsobO2);
+ $body .= sprintf("Isobutanoutput ratio : %.2f Warn(<70.0)\n", $IsobRefR);
+ $body .= sprintf("Scales: %.1fkg / %.1fkg\n",,$IsobScale1,$IsobScale2);
+ Hmon::SendEmail($currEmailAddr,"GAS WARNING IN RICH",$body);
+ }
+ $mailoutWarn = time();
+ }
+
+ if($qastate == QA::ERROR_2 && time()-$mailoutErr > 60*60) {
+ foreach my $currEmailAddr (@emailAddrs) {
+ my $body = "";
+ $body .= "The RICH gas system went in error state:\n";
+ $body .= sprintf("Isobutan pressure : %.2f bar Error(<0.7, >2.0)\n",$IsobPress);
+ $body .= sprintf("O2 concentration : %.1f ppm Error(>5000.0)\n",$IsobO2);
+ $body .= sprintf("Isobutanoutput ratio : %.2f Error(<50.0)\n", $IsobRefR);
+ $body .= sprintf("Scales: %.1fkg / %.1fkg\n",,$IsobScale1,$IsobScale2);
+ Hmon::SendEmail($currEmailAddr,"GAS ERROR IN RICH",$body);
+ }
+ $mailoutErr = time();
+ }
+
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
+ if(!$QA::RichGasOff && $hour==12 && $min==15 && $mailoutDaily==0) {
+ foreach my $currEmailAddr (@emailAddrs) {
+ my $body = "";
+ $body .= "It is 12:15 and time for your daily RICH gas mail:\n";
+ $body .= sprintf("Isobutan pressure : %.2f bar\n",$IsobPress);
+ $body .= sprintf("O2 concentration : %.1f ppm\n",$IsobO2);
+ $body .= sprintf("Isobutanoutput ratio : %.2f\n", $IsobRefR);
+ $body .= sprintf("Scales: %.1fkg / %.1fkg\n",,$IsobScale1,$IsobScale2);
+ Hmon::SendEmail($currEmailAddr,"Daily RICH gas mail",$body);
+ }
+ $mailoutDaily = 1;
+ }
+ if(!$QA::RichGasOff && $hour==12 && $min==16) {
+ $mailoutDaily = 0;
+ }
+
if( $timer % 4 == 0) {
$value = sprintf("%.1f|%.0f|%.0f",$IsobPress,$IsobO2,$IsobRefR);
$longtext = sprintf("isobutan pressure : %.2f bar | O2 concentration: %.1f ppm <br>|Isobutanoutput ratio: %.2f | Scales: %.1fkg / %.1fkg",$IsobPress,$IsobO2,$IsobRefR,$IsobScale1,$IsobScale2);
$cnt = ($i*2)+$j;
if ($data->{"U$cnt"}->{val}>=5490){$ChnlsOn++;}
elsif ($data->{"U$cnt"}->{val}>=4990){$ChnlsLow++;}
- print $data->{"U$cnt"}->{val}."\n";
}
}
#my @xpos = (15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14);
#my @ypos = (0,2,4,6,8,10,12,14,15,13,11,9,7,5,3,1);
-my @xpos = (1,3,5,7,9,11,13,15,14,12,10,8,6,4,2,0);
+#my @xpos = (1,3,5,7,9,11,13,15,14,12,10,8,6,4,2,0);
+my @xpos = (15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14);
my @ypos = (15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14);
+
+
while(1) {
$value = sprintf("HV is OFF");
$longtext = sprintf("HV is OFF");
}
- QA::WriteQALog($flog,"hv","tofhv",30,$qastate,"TOF HV",$value,$longtext);
+ QA::WriteQALog($flog,"hv","tofhv",50,$qastate,"TOF HV",$value,$longtext);
}
, "HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__0_+HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__1_+HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__2_+HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__3_+HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__4_+HadesQA/EMC/hEmc_mult_raw_sec/hEmc_mult_raw_sec__0__5_"
, "HadesQA/EMC/hEmc_raw_sec"
, "HadesQA/EMC/trending/hEmc_mult_raw_total_trend"
- , "HadesQA/EMC/hRpcrawsecmult/hRpcrawsecmult__0__4_"
, "HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__0_+HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__1_+HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__2_+HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__3_+HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__4_+HadesQA/EMC/trending/hEmc_mult_raw_sec_trend/hEmc_mult_raw_sec_trend__0__5_"
]'
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
-<title>MDCExpert - T3</title>
+<title>MDCExpert - Mb</title>
</head>
<body style="width:100%;border:none;height:98vh;overflow:hidden;margin:0;padding:0;">
-<iframe src='/qaweb/?browser=off&monitoring=10000&layout=grid3x2&opts=["colz+colz","colz+colz","colz+colz","colz+colz","colz+colz","colz+colz"]&items=
+<iframe src='/qaweb/?browser=off&monitoring=10000&layout=grid2x2&items=
[
- "HadesQA/MDC/stacks/hMdcmbotdcStack_0__3_/hMdcmbotdc__0__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_0__3_/hMdcmbotdcMissing__0__3_"
+ "HadesQA/MDC/hMdcMbo/hMdcmbotdc__0__0_"
,
- "HadesQA/MDC/stacks/hMdcmbotdcStack_1__3_/hMdcmbotdc__1__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_1__3_/hMdcmbotdcMissing__1__3_"
+ "HadesQA/MDC/hMdcMbo/hMdcmbotdc__0__1_"
,
- "HadesQA/MDC/stacks/hMdcmbotdcStack_2__3_/hMdcmbotdc__2__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_2__3_/hMdcmbotdcMissing__2__3_"
- ,
- "HadesQA/MDC/stacks/hMdcmbotdcStack_3__3_/hMdcmbotdc__3__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_3__3_/hMdcmbotdcMissing__3__3_"
- ,
- "HadesQA/MDC/stacks/hMdcmbotdcStack_4__3_/hMdcmbotdc__4__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_4__3_/hMdcmbotdcMissing__4__3_"
- ,
- "HadesQA/MDC/stacks/hMdcmbotdcStack_5__3_/hMdcmbotdc__5__3_+HadesQA/MDC/stacks/hMdcmbotdcStack_5__3_/hMdcmbotdcMissing__5__3_"
+ "HadesQA/MDC/hMdcMbo/hMdcmbotdc__0__2_"
,
+ "HadesQA/MDC/hMdcMbo/hMdcmbotdc__0__3_"
]'
style="height:100%;width:100%;border:none;margin:none;padding:none;" ></iframe>
}
+
div#content {
background:transparent !important;
/* transition: opacity .5s; */
margin-top:10px;
color:white;
width:100%;
- height:100px;
+ height:200px;
font-size:13px;
box-shadow:none !important;
clear:both;
padding:0;
overflow:hidden;
}
+
+
+
+#duck {
+ display:hidden;
+ }
+
+body:has(.QA) #duck {
+ position:absolute;
+ left:0;
+ bottom:0;
+ width:100%;
+ height:50px;
+ background-image:url('/mon/daqi.png');
+ background-size:contain;
+ background-repeat:no-repeat;
+ background-position: 0 0;
+ will-change: transform;
+ /*animation: animatedBackground 60s infinite steps(100,end);*/
+}
+
+@keyframes animatedBackground {
+ 0% {
+ background-position: -10% 0;
+ transform: scaleX(1) translateZ(0);
+ }
+ 50% {
+ background-position: 110% 0;
+ transform: scaleX(1) translateZ(0);
+ }
+ 50.000001% {
+ background-position: -10% 0;
+ transform: scaleX(-1) translateZ(0);
+ }
+ 100% {
+ background-position: 110% 0;
+ transform: scaleX(-1) translateZ(0);
+ }
+}
+
+