Current version: 1.1.0
The logbook functionality is implemented by a single daemon elogd program which is written in C. It uses structured ASCII files to store logbook pages, which can be retrieved through any web browser. Logbook entries can either be entered with a command line program or through the Web interface. Since only forms and tables are used, no Java or Javascript are necessary, which makes the logbook display very fast.
The features of ELOG make it useful for several applications:
ELOG is part of the MIDAS data acquisition system, but it can also be downloaded separately.
tar -xzvf elog-x.x.tar.gz
.
This creates a subdirectory elog-x.x
where x.x is the
version number. In that directory execute make
, which
creates the executables elogd
and elog
. These executables can then be copied to a convenient place like
/usr/local/bin
or ~/bin
.
The daemon elogd can be started manually with
elogd -p 8080
where the -p flag specifies the port. Without the -p flag, the server uses the standard WWW port 80. Note that ports below 1024 can only be uses if elogd is started a root, or the "sticky bit" is set on the executable.
If the program complains with something like "cannot bind to port...", it
could be that the network is not started on the Linux box. This can be
checked with the /sbin/ifconfig
program, which must
show that eth0
is up and running.
To start the daemon automatically, it can be run from the /etc/rc.d/init.d system. Please consult your distribution to find out how to do that. I use a script which I put under /etc/rc.d/init.d. Then I call
chkconfig --add elogd
which works fine under RedHat 6.x.
gcc -L/usr/lib/ -ldl -lresolv -lm -ldl -lnsl -lsocket elogd.c -o elogd
elogxxx.exe
file which expands
to the two source files and the executables (do not omit the exe
extension, it's necessary!). The daemon elogd.exe
can be started directly. Under Windows, the ports below 1024 can be used
without restriction. So if no web server is running on the same PC the ELOG
daemon listens under the standard Web port 80.
Under Windows NT/2000, elogd can be started also as a service. To do so, one
needs the programs srvany.exe
and instsrv.exe
from the Windows Resource Kit. If you don't have the Resource Kit, these
programs can probably be downloaded from various places like
this..
Then follow these steps:
INSTSRV ELogd %windir%\system32\srvany.exe
It was reported that the above mentioned srvany can only be run if the cygwin1.dll from the CygWin project is installed.
elogd.cfg
file. If this file is not in the current
directory where elogd is started, it can be specified via the command line
parameter -c
. Under UNIX, you would typically
start the daemon with
elogd -p 8080 -c /usr/local/elog/elogd.cfg -D
where the -D
flag tells elogd to start as a daemon
in the background (does not work under NT). Once the configuration file
is changed, the daemon has to be restarted.
To test the daemon, connect to your host via
http://your.host:8080/
If port 80 is used, the port can be omitted in the URL. If several logbooks are defined on a host, they can be specified in teh URL like
http://your.host/<logbook>where
<logbook>
is the name of the logbook.
The configuration file elogd.cfg
has a simple
ASCII format, here is an example:
[Linux] Theme = default Comment = General linux tips and tricks Write Password=aGl4X21pZA== Data dir = /usr/local/elog/linux Types = Routine, Software Installation, Problem Fixed, Configuration, Tips & Tri cks, Info, Other Categories = General, Hardware, Software, Network, Applications, Shell, Account, Packages, Daemons, Other Authors = you, me, nobody [PC] Comment = PC general informatoin Data dir = /usr/local/elog/pc Types = Routine, Common Problems, Problem Fixed, BIOS Configuration, Other Categories = General, Hardware, Software, Network, Other SMTP host = mailsend.your.domaine Email Common Problems = name@address, othername@otheraddressEach logbook is defined by a
[<name>]
section
where <name> is the name of the logbook.Following options are possible in the configuration file:
Theme
Comment
Data dir
Types
Categories
Authors
Read password
Write password
Delete password
Write password expiration
Delete password expiration
-r
, -w
and -d
flags. To set the
write password of logbook "linux" to "test", on would enter:
elogd -w test -l linux
The read password is queried by the browser with a pop-up window and usually stays
active for the entire browser session. The write and delete passwords are stored
in cookies on the browser side and have an expiration time of 24h. After that
time, the passwords have to be re-submitted. This time can be changed with the
statement Write Password Expriation = x
or Delte
Password Expriation = x
, where x is the expiration time in
hours. It should be noted that on some systems the daylight saving time is calculated
incorrectly, which can cause time offsets of one our between a server PC and a client
PC. In this case one hour has to be added to the expiration time.
SMPT host
Email <name> = list
SMTP host =
entry has to be present in the configuration file. The host name you can
get from your email program or your local system administrator. To submit an email
based on a type or category, one needs the statement Email <name> =
list
where name
is one of the type or category
names. Several mail addresses might be supplied, separated by commas. Multiple
Email xxx
statements might be present in a configuration file.
The statement Email All =
sends an email notification
independent of the type and category.
Allow delete = 0/1
Allow edit = 0/1
If this flag is 1, messages can be edited. Default is 1.
Summary on default = 0/1
If this flag is 1, the buttons "Last day" and "Last 10"
produce summary listings instead displaying full messages. In the "Query"
page, the "Summary only" check box is checked by default.
Summary lines = x
This specifies the number of text lines displayed in a summary page. Zero displays
no text at all. The default is 3.
Suppress default = 0/1
This specifies the default state of the "Suppress Email notification" button on
the new message entry from. For installations where normally a Email notification is
not necessary, the default can be set to 1. Only if an urgent message is entered,
the users can then uncheck the suppress box.
theme = <dir>
option in the configuration file. The directory
contains the file theme.cfg
and a couple of images, which are used
for the title banner and the browse buttons. A default theme is contained in the
distribution. If new themes are developed by users, they can send them back to the author,
so they can be included in future releases.
Most of the options in the theme.cfg
are self-explanatory, the colors
are coded as #RRGGBB, where RR is a 8-bit hexadecimal value for the red part, GG for the
green and BB for the blue part, repectively. Since theme configuration files are re-read
at each access, the elogd daemon does not have to be restarted after a change in the
theme configuration file.
Following two images display the same logbook page using different themes:
elogd
progream does not support secure
connections over SSL directly, it is possible to use it together with
stunnel to do so. Three steps are
necessary:
elogd
. If another Web server is running
on port 80, use a different port.
stunnel
program if not already done
and start it with:
stunnel -d 443 -r your.host.name:80Substitute the port 80 if you started elgod on another port. This causes stunnel to receive requests on the https port 443 and forwards them to the elogd port.
https://your.host.name/
elogd
through a SSH tunnel.
To do so, open an SSH tunnel like:
ssh -L 1234:your.server.name:8080 your.server.nameThis opens a secure tunnel from your local host, port 1234, to the server host where the
elogd
daemon is running on port 8080. Now you can
access http://localhost:1234
from your browser and reach
elogd in a secure way.
It is possible to submit the text as HTML text, so one can put HTML formatting
tags inside the text. Note that one then needs the tag <P>
tag
to start a new paragraph.
Attachments can be submitted similar to email attachments. Enter the file name or push the Browse button to select a local file. This file gets submitted into the logbook. If it is a picture (GIF or JPEG), it gets displayed in the logbook page. Otherwise only a link to the file inside the logbook is shown. By clicking at that link, the original file can be downloaded to the local hard disk again. This feature can be used to store things like Linux configuration files, which can then be retrieved easily without any copy and paste.
It is possible to pre-populate the author, type, category and subject field. This can be useful if always the same author for example submits entries from one PC. In this case, she/he needs a bookmark of the form:
http://your.host/your_logbook/?cmd=New&pauthor=joe&ptype=InfoIf this bookmark is executed, the author field gets automatically pre-populated with "joe" and the type "Info" gets selected. The same is possible using
pcategory
and psubject
. So one can
define a set of bookmarks for certain types of logbook entries.
elog
elog
can be used. The parameters
are:
elog -h hostname [-p port] [-l logbook] [-w password] -a author -t type -c category -b subject -f attachment -m textfile | textIf some of the parameters are not supplied, they are asked for interactively. The message text can be entered directly. If the EDITOR environment variable is set, the specified editor is used. Alternatively, the message text can be submitted from a file with the
-m
flag.
The elog
program makes it possible to submit logbook
entries automatically by the system or from scripts. In some shift logbooks
this feature is used to enter alarm messages automatically into the logbook.
The database ELOG save messages is a plain ASCII format. One file is
created for each day in the form YYMMDD.log
where
YY is the year, MM the montdh and DD the day. The only non-ASCII character
is a form-feed at the end of each message. If one sends a log file directly
to a printer, each message is therefore printed on a separate page. Note
that the log files should not be edited manually, since this could invalidate
the internal database structure (each header contains the message length
in bytes which then would become wrong).
If attachment are submitted, they are saved as separate files with the name
YYMMDD_HHMMSS_name
where in addition to the date the
time is specified and name
is the original file name of
the attachment. To copy the database to another computer, only the *.log
files and the attachment files need to be copied. To copy for example all
files form March 2001, one can select them with 0103??.log
and 0103??_*
.