Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wsrtinfo:sensoralarmdescription [2008/07/03 13:21] arnoschoenmakerswsrtinfo:sensoralarmdescription [2009/08/24 07:11] (current) arnoschoenmakers
Line 1: Line 1:
 ====== Description of sensorAlarm ====== ====== Description of sensorAlarm ======
  
-SensorAlarm pools the database filled by ''readsensor'' and checks for alarm conditions. Alarms are given based on criteria. The table with all criteria and actions is given below.+Program ''sensorAlarm'' polls the database filled by ''readsensor'' and checks for alarm conditions. Alarms are given based on criteria and are provided in a file. The table with all criteria and actions is given [[#alarmconditions|below]].
  
 ===== Location of the code ===== ===== Location of the code =====
  
-The code for sensorAlarm can be found in CVS, in the module ''wsrt_mac/alarms''. The following files are used by the sensorAlarm program:  +The code for ''sensorAlarm'' can be found in CVS, in the module ''wsrt_mac/alarms''. The following files are used by the ''sensorAlarm'' program:  
    * ''alarmActions.py'' -> class to execute shell-commands and send mail to the observer on duty.    * ''alarmActions.py'' -> class to execute shell-commands and send mail to the observer on duty.
    * ''class_sensorAlarm.py'' -> class that does most of the things    * ''class_sensorAlarm.py'' -> class that does most of the things
Line 11: Line 11:
    * ''log.py'' -> defines a function to print a log message with date/time stamp.    * ''log.py'' -> defines a function to print a log message with date/time stamp.
    * ''sensorAlarm.py'' -> Main program    * ''sensorAlarm.py'' -> Main program
 +
 +The program can be started by executing ''sensorAlarm.py''; no commandline options are needed for a default run. It should be started by user ''monitor'' on the WSRT monitor host (now wop10). The files should be present in directory ''/wsrt/bin'' on wop10.
  
 ===== Component description ===== ===== Component description =====
Line 30: Line 32:
   * Setting the alarmstatus of all the associated sensors to ''on'' in the Sensor database(s).   * Setting the alarmstatus of all the associated sensors to ''on'' in the Sensor database(s).
  
-Before obtaining the values, we first check if the sensor database values are recent enough to trust. This limit is set at 10 minutes, i.e., only if the database contains values less than 10 minutes old, the alarmconditions will be evaluated. All values are taken from the local MySQL database (the one running on wop33, that is).+Before obtaining the values, we first check if the sensor database values are recent enough to trust. This limit is set at 10 minutes, i.e., only if the database contains values less than 10 minutes old, the alarmconditions will be evaluated. All values are taken from the local MySQL database (the one running on wop10, that is).
  
 In the ''alarmconditions.cfg''-file is a column that gives the amount of individual samples/measurements of a sensor value to take into account. This is done in the following way: In the ''alarmconditions.cfg''-file is a column that gives the amount of individual samples/measurements of a sensor value to take into account. This is done in the following way:
Line 80: Line 82:
   * Wait until the next requested checktime.   * Wait until the next requested checktime.
  
 +==== Used Python modules ====
  
 +For ''sensorAlarm'', we have used the following Python modules:
 +  * For string handling: ''string''
 +  * For date and time issues: ''time'' and ''datetime''
 +  * For system calls and such : ''os'', ''sys'' and ''popen2''
 +  * For signal handling (timeouts): ''signal''
 +  * For parsing commandline options: ''optparse'' (see [[http://docs.python.org/lib/module-optparse.html|here]]). 
 +  * For MySQL connections: ''MySQLdb'' (see [[http://mysql-python.sourceforge.net/MySQLdb.html| the manual]] and [[https://sourceforge.net/projects/mysql-python| the project page]]).
 + 
 +
 +==== The configuration file ====
 +
 +The ''alarmconditions.cfg''-file has lines like this:<code>
 +
 +...
 +CONSwarm > 27.0 # 5 # sendMail obs 'Console too warm'
 +CONSwarm > 30.0 # 5 # sendMail obs 'Console meltdown'
 +CONSwarm < 15.0 # 5 # sendMail obs 'Console too cold'
 +...
 +Sup-He-RT0 + Ret-He-RT0 < 15 # 5 # sendMail stiepel 'He-pressure RT0 too low'
 +Sup-He-RT1 + Ret-He-RT1 < 15 # 5 # sendMail stiepel 'He-pressure RT1 too low'
 +Sup-He-RT2 + Ret-He-RT2 < 15 # 5 # sendMail stiepel 'He-pressure RT2 too low'
 +...
 +</code>
 +\\
  
  
Line 100: Line 127:
 ===== Alarmconditions ===== ===== Alarmconditions =====
  
-This is the Alarm conditions table that is used in the software. It originates from the file ''/wsrt/config/alarmconditions.cfg'' on wop33.+This is the Alarm conditions table that is used in the software. It originates from the file ''/wsrt/config/alarmconditions.cfg'' on wop10.
  
 ^ Sensor ^ Type/Unit^ Alarm Condition(s) ^ Nr. of samples ^ Mail/SMS who ^ (Software) Action ^ ^ Sensor ^ Type/Unit^ Alarm Condition(s) ^ Nr. of samples ^ Mail/SMS who ^ (Software) Action ^

QR Code
QR Code wsrtinfo:sensoralarmdescription (generated for current page)