/Elog ODB tree: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 5: Line 5:
* [[Mhttpd]]  
* [[Mhttpd]]  
* [[Elog Page]]
* [[Elog Page]]
*  
* [[Electronic Logbook (ELOG)]]
</div>
</div>


Line 14: Line 14:


= Purpose  =
= Purpose  =
The ODB <span style="color: purple; font-style:italic;">/Elog</span> tree contains the information necessary to run the Elog (Electronic Logbook), which is implemented through [[Mhttpd]]. By default, the '''internal''' elog is created. If an '''external''' elog is required, it must be set up to run on a port, and the file elogd.cfg created.
The ODB <span style="color: purple; font-style:italic;">/Elog</span> tree contains the information necessary to run the [[Electronic Logbook (ELOG)]], which is implemented through [[Mhttpd]]. By default, the '''built-in''' (or internal) elog is created. The '''built-in''' elog is set up through the <span style="color: purple; font-style:italic;">/Elog</span> tree.
See [https://midas.psi.ch/elog/adminguide.html#config ELOG Administrators Guide].
 
 
If an '''external''' elog is required, it must be installed (see [[Electronic Logbook (ELOG)#External Elog|External Elog]]) and will '''replace''' the built-in elog. Two optional keys [[#Url|Url]] and [[#Logbook Dir|Logbook Dir]] must be created in the <span style="color: purple; font-style:italic;">/Elog</span> tree when using an '''external''' elog. The '''external''' elog is set up through the [[Electronic Logbook (ELOG)#Configuration file elogd.cfg|configuration file]] rather than the {{Odbpath|path=/Elog}} tree.


= Location of ELOG Files =
= Location of ELOG Files =
By default, elog files are written into the directory path given by the ODB key  
By default, '''built-in''' elog files are written into the directory path given by the ODB key  
[[Keys in the ODB /Logger tree#Data Dir|/Logger/Data dir]].
[[Keys in the ODB /Logger tree#Data Dir|/Logger/Data dir]].


This location can be changed by use of the ODB Key [[Keys in the ODB /Logger tree#Elog Dir|/Logger/Elog dir]]. This key is optional and doesn't appear by default in the /<span style="color: purple; font-style:italic;">/Logger</span> tree, but can be created by the user if desired. If this key is present, the location of the Internal Electronic logbook (Elog) files is reassigned to the defined path.
This location can be changed by use of the ODB Key [[Keys in the ODB /Logger tree#Elog Dir|/Logger/Elog dir]]. This key is optional and doesn't appear by default in the /<span style="color: purple; font-style:italic;">/Logger</span> tree, but can be created by the user if desired. If this key is present, the location of the Internal Electronic logbook (Elog) files is reassigned to the defined path.


If using an '''External''' Elog, the location of the files are given by the key
If using an '''external''' Elog, the location of the files are given by the ODB key [[#Logbook Dir|Logbook Dir]]




== Examples ==
== Examples ==
=== Example 1 ===
=== Example 1 - The /elog tree  ===
When initially created (see [[#Creating the /Elog tree#above]] the <span style="color: purple;">''/Experiment''</span> tree contains the following keys:
When initially created (see [[#Creating the /Elog tree|above]]) the <span style="color: purple;">''/Experiment''</span> tree contains the following keys:
 
  [local:midas:S]/>ls -lrt /elog
  [local:midas:S]/>ls -lrt /elog
  Key name                        Type    #Val  Size  Last Opn Mode Value
  Key name                        Type    #Val  Size  Last Opn Mode Value
  ---------------------------------------------------------------------------
  ---------------------------------------------------------------------------
Line 41: Line 43:
                                         [2]            7d
                                         [2]            7d
    
    
=== Example 2 ===
=== Example 2 - Types and Systems ===
Creating a New message (by clicking on the <span style="color: #444444; background-color: #CCCCCC; font-style:italic; font-size: 90; padding:0.25em;
Creating a New message (by clicking on the <span style="color: #444444; background-color: #CCCCCC; font-style:italic; font-size: 90; padding:0.25em;
padding-left: 0.5em;padding-right: 0.5em;border:1px solid #808080;border-radius: 5px;margin-bottom:1px;">New</span>  button
padding-left: 0.5em;padding-right: 0.5em;border:1px solid #808080;border-radius: 5px;margin-bottom:1px;">New</span>  button
on the [[Elog Page]] results in the full /Elog tree being created, i.e.
on the '''Built-in''' [[Elog Page]] results in the full /Elog tree being created, i.e.


  [local:test:S]/>ls -lrt /elog
  [local:test:S]/>ls -lrt /elog
Line 100: Line 102:
     Host name                  STRING  1    256  9m  0  RWD  dasdevpc2.triumf.ca
     Host name                  STRING  1    256  9m  0  RWD  dasdevpc2.triumf.ca
   
   
=== Example 3 ===
=== Example 3 - Sending email ===
The user can optionally add keys so that email is sent to users when messages with particular Type or System are created, e.g.
The user can optionally add keys so that email is sent to users when messages with particular Type or System are created, e.g.


     Email Severe error          STRING  1    32    57s  0  RWD  midas@triumf.ca
     Email Severe error          STRING  1    32    57s  0  RWD  midas@triumf.ca
     Email DAQ                  STRING  1    32    28s  0  RWD  abe.triumf.ca, cal@triumf.ca
     Email DAQ                  STRING  1    32    28s  0  RWD  abe@triumf.ca, cal@triumf.ca
     SMTP host                  STRING  1    32    53m  0  RWD  localhost
     SMTP host                  STRING  1    32    53m  0  RWD  localhost


=== Example 4 ===
For '''External''' Elog see [[#Note|note]].
If running an '''External''' elog, the following keys will be added


     Url                        STRING 1    64    >99d 0  RWD  http://isdaq60.triumf.ca:8089/BNMRonline/
=== Example 4 - External elog ===
If running an '''External''' elog, the following keys must be added by the user:
 
     External Elog              BOOL 1    64    >99d 0  RWD  y
     Logbook Dir                STRING  1    64    >99d 0  RWD  /data1/elog/logbook/
     Logbook Dir                STRING  1    64    >99d 0  RWD  /data1/elog/logbook/


== Keys in <span style="color: purple;">''/Elog''</span> tree==
== Keys in <span style="color: purple;">''/Elog''</span> tree==


The keys in the ODB <span style="color: purple;">''/Elog tree''</span>  
The keys in the ODB <span style="color: purple;">''/Elog tree''</span>  
are described in the following sections.
are described in the following sections. Except where noted, the keys are used by the '''Built-in''' elog only. The
 
[[Electronic Logbook (ELOG)#Configuration file elogd.cfg|configuration file]] is used to setup the '''External''' elog.
=== <span style="color: purple;">''Display Run number ''</span>  ===
=== <span style="color: purple;">''Display Run number ''</span>  ===
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
Line 124: Line 127:
* '''Default:'''  y
* '''Default:'''  y
</div>  
</div>  
This key in the [[#top|/Elog tree]] enables/disables displaying the run number in the elog entry. Set to 'y' when the tree is created.
This key in the [[#top|/Elog tree]] enables or disables the automatic display of the run number in the '''Built-in''' elog entry. This key is set to 'y' when the tree is created.
 
For '''External''' elog see [[#Note|note]].
 


<br>
<br>
Line 135: Line 141:
* '''Default:'''  n
* '''Default:'''  n
</div>  
</div>  
This key in the [[#top|/Elog tree]] enables/disables deleting an elog entry. Set to 'n' when the tree is created.
This key in the [[#top|/Elog tree]] enables or disables allowing the user to delete an elog entry. This key is set to 'n' when the tree is created.
 
For '''External''' elog see [[#Note|note]].  


<br>
<br>
Line 146: Line 154:
* '''Default:'''  8h 24h 7d
* '''Default:'''  8h 24h 7d
</div>  
</div>  
This key in the [[#top|/Elog tree]] causes buttons to be created on the [[Elog Page]] to permits the user to easily recall Elog messages for up to four possible time spans. The example above shows that all messages in the last 8 hours, 24 hours, or 7 days can be recalled by pressing the appropriate button.  
This key in the [[#top|/Elog tree]] causes buttons to be created on the [[Elog Page]] to permit the user to easily recall Elog messages for up to four possible time spans. [[#Example 1 - The /elog tree|Example 1]] shows three time spans; all messages in the last 8 hours, 24 hours, or 7 days can be recalled by pressing the appropriate button.
 
For '''External''' elog see [[#Note|note]].
 
 
<br>
<br>
--------
--------
Line 155: Line 167:
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING ARRAY
* '''Type:''' STRING ARRAY
* '''Default:'''  Routine,Shift summary,Minor error,Severe error,Fix,Question,Info,Modification,Reply,Alarm,Test,Other
* '''Default:'''  See [[#Example 2 - Types and Systems|Example 2]]
</div>  
</div>  
This key in the [[#top|/Elog tree]] causes a drop-down list of message '''Types''' to be created on the [[Elog Page]]. The user must select one of these message '''Types''' when he/she creates a message. The message types can be customized, or more can be added, by editing the <span style="color: purple;">''Types''</span> key.
This key in the [[#top|/Elog tree]] causes a drop-down list of '''Message Types''' to be created on the [[Elog Page]] containing the list of message types defined by the '''Types''' array. The user selects one of these message types when creating a message. The message types can be customized by editing the <span style="color: purple;">''Types''</span> key.
 
The default '''Types''' are shown in [[#Example 2 - Types and Systems|Example 2]].
 
For '''External''' elog see [[#Note|note]].  


<br>
<br>
Line 166: Line 182:
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING ARRAY
* '''Type:''' STRING ARRAY
* '''Default:'''    General,DAQ,Detector,Electronics,Target,Beamline
* '''Default:'''    See [[#Example 2 - Types and Systems|Example 2]]
</div>  
</div>  
This key in the [[#top|/Elog tree]] causes a drop-down list of '''Systems''' to be created on the [[Elog Page]]. The user must select one of these '''Systems''' when he/she creates a message. The '''Systems''' can be customized, or more can be added, by editing the <span style="color: purple;">''Systems''</span> key.
This key in the [[#top|/Elog tree]] causes a drop-down list of '''Systems''' to be created on the [[Elog Page]] containing the list of systems defined by the '''Systems''' array. The user selects one of these systems when creating a message. The systems can be customized by editing the <span style="color: purple;">''Systems''</span> key.
 
The default '''Systems''' are shown in [[#Example 2 - Types and Systems|Example 2]].
 
For '''External''' elog see [[#Note|note]].  


<br>
<br>
Line 180: Line 200:
</div>  
</div>  
This key in the [[#top|/Elog tree]] contains the name of the host machine. It is created and filled automatically when the elog tree is created.
This key in the [[#top|/Elog tree]] contains the name of the host machine. It is created and filled automatically when the elog tree is created.
<br>
<br>
--------
--------
Line 189: Line 210:
* '''Default:'''  localhost
* '''Default:'''  localhost
</div>  
</div>  
This optional key in the [[#top|/Elog tree]] contains the name of the SMTP host machine for sending out email. It must be created and filled by the user if any email is to be sent out apprising user(s) of new Elog messages.  
This optional key in the [[#top|/Elog tree]] contains the name of the SMTP host machine for sending out email. It must be created and filled by the user if any email is to be sent out apprising user(s) of new Elog messages  
(see key [[#Email <type/system>|Email <type/system>]]).
 
For '''External''' elog see [[#Note|note]].  
<br>
<br>
--------
--------
<br>
<br>


=== <span style="color: purple;">''Email [XXX]''</span>  ===
=== <span style="color: purple;">''Email <type/system>''</span>  ===
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''  email address(es) of user(s)
* '''Default:'''  email address(es) of user(s)
</div>  
</div>  
These optional keys in the [[#top|/Elog tree]] are created if email is to be sent out when a new ELOG message for a particular '''Type''' or '''System''' is created.  The '''Type''' or '''System''' name must appear in the [[#Type|Type]] or [[#System|System]] array defined by the keys
These optional keys in the [[#top|/Elog tree]] are created if email is to be sent out when a new ELOG message for a particular '''Type''' or '''System''' is created.  The '''Type''' or '''System''' name must appear in the [[#Types|Types]] or [[#Systems|Systems]] array. For email to be sent out, the key [[#SMTP host|SMTP host]] must also be defined.


For example, if keys "Email Severe error" and "Email DAQ" are created
For example, if Type "Severe error" is defined, then if ODB key <span style="color: purple;">''Email Severe Error''</span> is created containing suitable email address(es) (see [[#Example 3 - Sending email|example 3]]) , if a new message is created of Type "Severe error", then email containing the new elog entry will be sent automatically to the listed email address(es).  
containing suitable email addresses (as in [[#Example 3|example 3]]) , email containing the new elog entry will be sent to the appropriate address(es) automatically if the new message is of either Type="Severe error" or System="DAQ".  
   
   
 
Similarly, if System "DAQ" is defined, then if ODB key <span style="color: purple;">''Email DAQ''</span>  is created
as in [[#Example 3 - Sending email|example 3]]) , email containing the new elog entry will be sent automatically if the new message has selected System "DAQ".
For '''External''' elog see [[#Note|note]].
<br>
<br>
--------
--------
Line 214: Line 240:
* '''Default:'''   
* '''Default:'''   
</div>  
</div>  
This optional key in the [[#top|/Elog tree]] contains the URL of the host machine that is running the '''External''' elog. It is created and filled by the user (see [[#Example 4|example 4]]).
This optional key in the [[#top|/Elog tree]] contains the URL of the host machine that is running the '''External''' elog. It is created and filled by the user (see [[#Example 4 - External email|example 4]]). If using an '''External''' elog, this key '''must''' be present; the elog information will be redirected to the external elog. The '''Built-in''' elog will ignore this key.


If using an '''Internal''' Elog, this key is not present.
If using an '''Built-in''' Elog, this key will be ignored.


   
   
Line 228: Line 254:
* '''Default:'''   
* '''Default:'''   
</div>  
</div>  
This optional key in the [[#top|/Elog tree]] contains the path of a directory to contain the elog files when running the '''External''' elog. It is created and filled by the user (see [[#Example 4|example 4]]).
This optional key in the [[#top|/Elog tree]] contains the path of a directory to contain the elog files when running the '''External''' elog. It is created and filled by the user (see [[#Example 4 - External email|example 4]]).  


If using an '''Internal''' Elog, this key is not present.
If using an '''Built-in''' Elog, this key is ignored.


   
   
Line 237: Line 263:
<br>
<br>


--------------------------------------------------------------------------------------------
<div id="Note"></div>
Note;
: This feature can be found in the [[Electronic Logbook (ELOG)#Configuration file elogd.cfg|configuration file]] for the '''External''' elog.


[[Category:ODB Tree]]
[[Category:ODB Tree]] [[Category:ELOG]]

Latest revision as of 15:31, 19 June 2023


Links

Creating the /Elog tree

The /Elog tree is created automatically the first time the ELOG button on the mhttpd Status Page is pressed.

Purpose

The ODB /Elog tree contains the information necessary to run the Electronic Logbook (ELOG), which is implemented through Mhttpd. By default, the built-in (or internal) elog is created. The built-in elog is set up through the /Elog tree.


If an external elog is required, it must be installed (see External Elog) and will replace the built-in elog. Two optional keys Url and Logbook Dir must be created in the /Elog tree when using an external elog. The external elog is set up through the configuration file rather than the /Elog tree.

Location of ELOG Files

By default, built-in elog files are written into the directory path given by the ODB key /Logger/Data dir.

This location can be changed by use of the ODB Key /Logger/Elog dir. This key is optional and doesn't appear by default in the //Logger tree, but can be created by the user if desired. If this key is present, the location of the Internal Electronic logbook (Elog) files is reassigned to the defined path.

If using an external Elog, the location of the files are given by the ODB key Logbook Dir


Examples

Example 1 - The /elog tree

When initially created (see above) the /Experiment tree contains the following keys:

[local:midas:S]/>ls -lrt /elog
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Elog                            DIR
   Display run number          BOOL    1     4     17m  0   RWD  y
   Allow delete                BOOL    1     4     17m  0   RWD  n
   Buttons                     STRING  3     32    17m  0   RWD
                                       [0]             8h
                                       [1]             24h
                                       [2]             7d
  

Example 2 - Types and Systems

Creating a New message (by clicking on the New button on the Built-in Elog Page results in the full /Elog tree being created, i.e.

[local:test:S]/>ls -lrt /elog
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Elog                            DIR
   Display run number          BOOL    1     4     13m  0   RWD  y
   Allow delete                BOOL    1     4     13m  0   RWD  n
   Buttons                     STRING  3     32    13m  0   RWD
                                       [0]             8h
                                       [1]             24h
                                       [2]             7d
   Types                       STRING  20    32    9m   0   RWD
                                       [0]             Routine
                                       [1]             Shift summary
                                       [2]             Minor error
                                       [3]             Severe error
                                       [4]             Fix
                                       [5]             Question
                                       [6]             Info
                                       [7]             Modification
                                       [8]             Reply
                                       [9]             Alarm
                                       [10]            Test
                                       [11]            Other
                                       [12]
                                       [13]
                                       [14]
                                       [15]
                                       [16]
                                       [17]
                                       [18]
                                       [19]
   Systems                     STRING  20    32    9m   0   RWD
                                       [0]             General
                                       [1]             DAQ
                                       [2]             Detector
                                       [3]             Electronics
                                       [4]             Target
                                       [5]             Beamline
                                       [6]
                                       [7]
                                       [8]
                                       [9]
                                       [10]
                                       [11]
                                       [12]
                                       [13]
                                       [14]
                                       [15]
                                       [16]
                                       [17]
                                       [18]
                                       [19]
   Host name                   STRING  1     256   9m   0   RWD  dasdevpc2.triumf.ca

Example 3 - Sending email

The user can optionally add keys so that email is sent to users when messages with particular Type or System are created, e.g.

   Email Severe error          STRING  1     32    57s  0   RWD  midas@triumf.ca
   Email DAQ                   STRING  1     32    28s  0   RWD  abe@triumf.ca, cal@triumf.ca
   SMTP host                   STRING  1     32    53m  0   RWD  localhost

For External Elog see note.

Example 4 - External elog

If running an External elog, the following keys must be added by the user:

   External Elog               BOOL  1     64    >99d 0   RWD  y
   Logbook Dir                 STRING  1     64    >99d 0   RWD  /data1/elog/logbook/

Keys in /Elog tree

The keys in the ODB /Elog tree are described in the following sections. Except where noted, the keys are used by the Built-in elog only. The configuration file is used to setup the External elog.

Display Run number

  • Type: BOOL
  • Default: y

This key in the /Elog tree enables or disables the automatic display of the run number in the Built-in elog entry. This key is set to 'y' when the tree is created.

For External elog see note.





Allow delete

  • Type: BOOL
  • Default: n

This key in the /Elog tree enables or disables allowing the user to delete an elog entry. This key is set to 'n' when the tree is created.

For External elog see note.




Buttons

  • Type: STRING ARRAY
  • Default: 8h 24h 7d

This key in the /Elog tree causes buttons to be created on the Elog Page to permit the user to easily recall Elog messages for up to four possible time spans. Example 1 shows three time spans; all messages in the last 8 hours, 24 hours, or 7 days can be recalled by pressing the appropriate button.

For External elog see note.






Types

This key in the /Elog tree causes a drop-down list of Message Types to be created on the Elog Page containing the list of message types defined by the Types array. The user selects one of these message types when creating a message. The message types can be customized by editing the Types key.

The default Types are shown in Example 2.

For External elog see note.




Systems

This key in the /Elog tree causes a drop-down list of Systems to be created on the Elog Page containing the list of systems defined by the Systems array. The user selects one of these systems when creating a message. The systems can be customized by editing the Systems key.

The default Systems are shown in Example 2.

For External elog see note.




Host name

  • Type: STRING
  • Default: e.g. myhost.triumf.ca

This key in the /Elog tree contains the name of the host machine. It is created and filled automatically when the elog tree is created.




SMTP host

  • Type: STRING
  • Default: localhost

This optional key in the /Elog tree contains the name of the SMTP host machine for sending out email. It must be created and filled by the user if any email is to be sent out apprising user(s) of new Elog messages (see key Email <type/system>).

For External elog see note.



Email <type/system>

  • Type: STRING
  • Default: email address(es) of user(s)

These optional keys in the /Elog tree are created if email is to be sent out when a new ELOG message for a particular Type or System is created. The Type or System name must appear in the Types or Systems array. For email to be sent out, the key SMTP host must also be defined.

For example, if Type "Severe error" is defined, then if ODB key Email Severe Error is created containing suitable email address(es) (see example 3) , if a new message is created of Type "Severe error", then email containing the new elog entry will be sent automatically to the listed email address(es).

Similarly, if System "DAQ" is defined, then if ODB key Email DAQ is created as in example 3) , email containing the new elog entry will be sent automatically if the new message has selected System "DAQ".

For External elog see note.



Url

  • Type: STRING
  • Default:

This optional key in the /Elog tree contains the URL of the host machine that is running the External elog. It is created and filled by the user (see example 4). If using an External elog, this key must be present; the elog information will be redirected to the external elog. The Built-in elog will ignore this key.

If using an Built-in Elog, this key will be ignored.





Logbook Dir

  • Type: STRING
  • Default:

This optional key in the /Elog tree contains the path of a directory to contain the elog files when running the External elog. It is created and filled by the user (see example 4).

If using an Built-in Elog, this key is ignored.






Note;

This feature can be found in the configuration file for the External elog.