]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
added sequencer monitor to QA
authorhadaq@countinghouse <hadaq@CountingHouse>
Fri, 15 Aug 2014 14:58:06 +0000 (16:58 +0200)
committerhadaq@countinghouse <hadaq@CountingHouse>
Fri, 15 Aug 2014 14:58:06 +0000 (16:58 +0200)
hmon/QA.pm
hmon/doc/main-speech.htt [new file with mode: 0644]
hmon/doc/other-sequencer.htt [new file with mode: 0644]
hmon/hmon_mdc_temp.pl
hmon/permanent/hmon_sequencer.pl [new file with mode: 0755]
hmon/speakdaemon.pl

index d05ee3bb377628c898d2890a0a7132d9b0460631..8cb7bb401687ca0ce565d6c20ffd98b7d35c980e 100644 (file)
@@ -32,7 +32,7 @@ our $entries->{'cats'} = ["main",
 ];
 
 # Order of entries in each cat
-$entries->{'main'}    = ['time', 'rate','onlineqa','up'];
+$entries->{'main'}    = ['time', 'rate','onlineqa','up','speech'];
 $entries->{'daq'}     = ['trbnet', 'timeouts', 'busy','readout'];
 $entries->{'trg'}     = ['spill', 'accepted', 'source','pt1rate',  'start']; #, 
 $entries->{'rate'}    = ['pt1','start','hodo','pion1','pion2'];
@@ -41,8 +41,8 @@ $entries->{'eb'}      = ['run', 'rate','bytes', 'lostevt', 'errbits'];
 $entries->{'mdc'}     = ['token', 'blocked', 'temp', 'linkqual', 'voltage'];
 $entries->{'endp'}    = ['mdc','rich', 'tof', 'rpc', 'other'];
 $entries->{'feeerr'}  = ['rich', 'trb', 'feeerr','trginp','trgqual'];
-$entries->{'other'}   = ['magnet','speech','rich','shower','mdcinvalid'];
 $entries->{'pion'}    = ['nxstatus', 'HV', 'HVcurr', 'cooling'];
+$entries->{'other'}   = ['magnet','rich','shower','mdcinvalid','sequencer'];
 
 
 our $QAServer = "hades33";
diff --git a/hmon/doc/main-speech.htt b/hmon/doc/main-speech.htt
new file mode 100644 (file)
index 0000000..b0a88fb
--- /dev/null
@@ -0,0 +1,11 @@
+<h3>Speech Output</h3>
+<p>
+This button shows the status of the speech deamon which gives you accustic informations in case of critical problems
+with any subsystem.
+
+<h4>Error Handling if the button is not <font color="gree">Green</font></h4>
+
+It can only be switched off. If that is the case, turn it on.
+
+
+
diff --git a/hmon/doc/other-sequencer.htt b/hmon/doc/other-sequencer.htt
new file mode 100644 (file)
index 0000000..892de8e
--- /dev/null
@@ -0,0 +1,6 @@
+<h3>EPICS HV Sequencer</h3>
+
+<p>Some high voltage control is not working any more. Please inform the MDC operator before taking any action.
+<h4>Error Handling</h4>
+<p>Click the 'Restart Sequencer' button in the control window or run on lxhadeb06:
+<br><pre>ssh scs@lxhadeb06 'echo -en "\x18" | netcat -w 1 localhost 4813</pre>
\ No newline at end of file
index c00d5530107645d0feada4841b83bf575a359197..5631056221c9aefeca18f55b27299fc4034ff714 100755 (executable)
@@ -23,11 +23,12 @@ my $values = {};
 my $color = {};
 my $raw = {};
 my $val;
+my $mailerrstatecnt = 0;
 my ($max,$min,$avg,$mean);
 
 trb_init_ports() or die trb_strerror();
 
-Perl2Epics::Connect("TempP2S","HAD:MDC:P2:S1:M1:temp");
+#Perl2Epics::Connect("TempP2S","HAD:MDC:P2:S1:M1:temp");
 
 while (1) {
   my $rh_mdc_temp;
@@ -73,5 +74,12 @@ while (1) {
                  "Max. temperature in each plane of MDC are " . $str);
   $store = {};
 
+  if($qastate >= QA::ERROR) {
+    if($mailerrstatecnt++ >= 30) {
+      Hmon::SendEmail('j.michel@gsi.de,c.wendisch@gsi.de',"Error: MDC Temperature too high","MDC temperatures are too high:  \n$str");
+      $mailerrstatecnt = 0;
+      }
+    }
+
   sleep 20;
 }
diff --git a/hmon/permanent/hmon_sequencer.pl b/hmon/permanent/hmon_sequencer.pl
new file mode 100755 (executable)
index 0000000..914abca
--- /dev/null
@@ -0,0 +1,129 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+
+use FileHandle;
+use Data::Dumper;
+use Hmon;
+use QA;
+use List::Util qw(min max);
+use Perl2Epics;
+
+my @names;
+my @variables = qw(
+
+HAD:TOFHV:G1:status:alive:roc:average
+HAD:TOFHV:G2:status:alive:roc:average
+HAD:TOFHV:G3:status:alive:roc:average
+HAD:TOFHV:G4:status:alive:roc:average
+HAD:TOFHV:G5:status:alive:roc:average
+HAD:TOFHV:G6:status:alive:roc:average
+HAD:FWHV:G7:status:alive:roc:average
+HAD:RPCHV:G8:status:alive:roc:average
+HAD:RPCHV:G9:status:alive:roc:average
+HAD:RICH:HV:G25:status:alive:roc:average
+HAD:SHWR:HV:G26:status:alive:roc:average
+HAD:SHWR:HV:G27:status:alive:roc:average
+HAD:SHWR:HV:G28:status:alive:roc:average
+HAD:SHWR:HV:G29:status:alive:roc:average
+HAD:SHWR:HV:G30:status:alive:roc:average
+HAD:SHWR:HV:G31:status:alive:roc:average
+HAD:RICH:HV:G32:status:alive:roc:average
+HAD:MDC:HV:G41:status:alive:roc:average
+HAD:MDC:HV:G42:status:alive:roc:average
+HAD:MDC:HV:G43:status:alive:roc:average
+HAD:MDC:HV:G44:status:alive:roc:average
+HAD:MDC:HV:G4011:status:alive:roc:average
+HAD:MDC:HV:G4012:status:alive:roc:average
+HAD:MDC:HV:G4013:status:alive:roc:average
+HAD:MDC:HV:G4014:status:alive:roc:average
+HAD:MDC:HV:G4015:status:alive:roc:average
+HAD:MDC:HV:G4016:status:alive:roc:average
+HAD:MDC:HV:G4021:status:alive:roc:average
+HAD:MDC:HV:G4022:status:alive:roc:average
+HAD:MDC:HV:G4023:status:alive:roc:average
+HAD:MDC:HV:G4024:status:alive:roc:average
+HAD:MDC:HV:G4025:status:alive:roc:average
+HAD:MDC:HV:G4026:status:alive:roc:average
+HAD:MDC:HV:G4031:status:alive:roc:average
+HAD:MDC:HV:G4032:status:alive:roc:average
+HAD:MDC:HV:G4033:status:alive:roc:average
+HAD:MDC:HV:G4034:status:alive:roc:average
+HAD:MDC:HV:G4035:status:alive:roc:average
+HAD:MDC:HV:G4036:status:alive:roc:average
+HAD:MDC:HV:G4041:status:alive:roc:average
+HAD:MDC:HV:G4042:status:alive:roc:average
+HAD:MDC:HV:G4043:status:alive:roc:average
+HAD:MDC:HV:G4044:status:alive:roc:average
+HAD:MDC:HV:G4045:status:alive:roc:average
+HAD:MDC:HV:G4046:status:alive:roc:average
+HAD:MDC:HV:P1:S1:TRIP:status:alive:roc:average
+HAD:MDC:HV:P1:S2:TRIP:status:alive:roc:average
+HAD:MDC:HV:P1:S3:TRIP:status:alive:roc:average
+HAD:MDC:HV:P1:S4:TRIP:status:alive:roc:average
+HAD:MDC:HV:P1:S5:TRIP:status:alive:roc:average
+HAD:MDC:HV:P1:S6:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S1:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S2:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S3:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S4:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S5:TRIP:status:alive:roc:average
+HAD:MDC:HV:P2:S6:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S1:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S2:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S3:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S4:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S5:TRIP:status:alive:roc:average
+HAD:MDC:HV:P3:S6:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S1:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S2:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S3:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S4:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S5:TRIP:status:alive:roc:average
+HAD:MDC:HV:P4:S6:TRIP:status:alive:roc:average
+HAD:MDC:TEMP:TempLV:status:alive:roc:average
+);
+
+# HAD:MDC:HV:Ind1:TRIP:status:alive:roc:average
+# HAD:MDC:HV:Ind2:TRIP:status:alive:roc:average
+# HAD:MDC:HV:Ind3:TRIP:status:alive:roc:average
+# HAD:MDC:HV:Ind4:TRIP:status:alive:roc:average
+
+my $flog = QA::OpenQAFile();
+
+for my $v (@variables) {
+  my $name = $v;
+  $name =~ s/:status:alive:roc:average//;
+  push(@names,$name);
+  Perl2Epics::Connect($name,$v);
+  }
+
+  
+  
+while(1) {
+  my $qastate = QA::OK;
+  my $count = 0;
+  my $longtxt = "";
+  my $data = Perl2Epics::GetAll();
+  
+  for my $v (@names) {
+    next if $data->{$v}->{val} < 0;
+    if($data->{$v}->{val} < 0.5) {
+      $qastate = max($qastate,QA::FATAL);
+      $longtxt .= "$v stopped, ";
+      $count++;
+      }
+#     elsif($data->{$v}->{val} < 0.95) {
+#       $qastate = max($qastate,QA::WARN);
+#       $longtxt .= "$v strange, ";
+#       $count++;
+#       }
+    }
+  
+  $longtxt = "All sequencers running" if $longtxt eq "";
+  my $value = ((scalar @names)-$count)."/".(scalar @names);  
+  QA::WriteQALog($flog,"other","sequencer",20,$qastate,"HV Sequencer",$value,$longtxt); 
+  
+  sleep(10);
+  }
+
index 344f70d89baa416b7fef5196cdc549881b2b8641..d4fd4b82f773a5f255520a823ba993e0addaae92 100755 (executable)
@@ -32,11 +32,11 @@ if($f) {
 else {
   while(1) {
     if($inhibit == 0) {
-      QA::WriteQALog($fq, "other", "speech", 120, QA::OK,
+      QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
                     "Speech Output", "running", "The speech daemon is running.");
       }
     else {
-      QA::WriteQALog($fq, "other", "speech", 120, QA::WARN,
+      QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
                     "Speech Output", "muted", "The speech daemon is muted.");
       }
     sleep 60;