SCG-html-agent.pl
USAGE:
SCG-html-agent-withlogfile.pl [options] <html-file-basename>
PURPOSE:
udp-server,
gravity residual file, and two html-functions:
A -
monitor.html - with numeric
table
B -
monitor-plot.html - png-file generation
STOP this program by using
touch ~/www/SCG/STOPRCV
Files:
monitor - > data
copied from socket
monitor.txt - > data for html
and plot
monitor.html - > html browser-ready
monitor.hdr - < html header
monitor.fot - < html foot
monitor-plot - < csh with GMT
monitor.ps - > plot
ps-file
PNG/monitor.png - > plot png-file
broker.name - < machine
for gap filling. Change with
set-broker -f {utter|elder}
HTML:
Besides what this script produces, there is the stage
of processing by
retro-agent serving user requests to
retrieve/create looks at "historic moments". A convenient way of
putting requests is offered in the earthquake shortlist provided
by eqwatch.pl and its kinship. The clickable link is
located in the yellow field below the main diagram in
monitor-plot.html
OPTIONS:
[Default]
-q -
no print to
STDOUT
[do print]
-l <log> - write to a
logfile
[STDOUT]
-c #cal - calibration
value, nm/s2 / V [-774.421]
-b #baro - baro coefficient,
nm/s2 / hPa
[-3.268]
-g #bias - subtract constant
from residual [280.0]
-p #port - udp port
number
[54321]
-S #len - length in
seconds to
preserve
[7200]
Scripts and programs called from this perlscript:
~hgs/perlproc/chop60
- csh
~hgs/perlproc/save36h
- csh
~hgs/perlproc/gaptest.awk
- awk
/home/hgs/www/SCG/monitor-plot - csh
/home/hgs/www/SCG/file2ymd-dir - csh
~hgs/bin/merge-monitor
- F77, ~/sas/p/mt/merge-monitor.f
scp
standard unix procedures like cp, mv,
rm
How does it work?
Well, the perl
code is unusually well commented.
This is what SCG-html-agent-withlogfile.pl produces in
/home/hgs/www/SCG/
-rw-rw-r-- 1 hgs hgs
103040 Apr 27 17:24 SCG-html-agent-2.log - log file
-rw-rw-r-- 1 hgs hgs
2245 Apr 27 17:23 monitor-plot.log -
log file from plotting
-rw-rw-r-- 1 hgs users 16198 Apr 27
17:23 coldheaduse.ps -
updated number of hours since last
change, in postscript
-rw-rw-r-- 1 hgs users 215289 Apr 27 17:23
monitor.ps - postscript:
central diagram
-rw-rw-r-- 1 hgs users 28692 Apr 27
17:23 monitor-ap.ts - Binary
file: air pressure
-rw-rw-r-- 1 hgs users 28892 Apr 27
17:23 monitor-pt.ts - Binary
file: predicted tides
-rw-rw-r-- 1 hgs users 28892 Apr 27
17:23 monitor-bp.ts - Binary
file: inferred sea bottom pressure
-rw-rw-r-- 1 hgs hgs 28892
Apr 27 17:23 monitor.ts
- Binary file: gravity
-rw-rw-r-- 1 hgs users 417873 Apr 27 17:23
monitor.html -
the monitor page
-rw-rw-r-- 1 hgs hgs 409920 Apr
27 17:23 monitor
- the last 3660 seconds of the
accumulated UDP-stream
-rw-rw-r-- 1 hgs hgs 416640 Apr
27 17:23 monitor.txt
- the last 3720 seconds of the accumulated
UDP-stream
-rw-rw-r-- 1 hgs users 4226 Apr 27 17:25
PNG/coldheaduse.png - updated number of hours since
last change, in graphics
-rw-rw-r-- 1 hgs users 186437 Apr 27 17:25
PNG/monitor.png - png:
central diagram
-rw-rw-r-- 1 hgs hgs
827463 Apr 27 15:05 tpplot/tide-press.ps - the diagram at
the upper right
Log files:
SCG-html-agent-#n.log - #n = 1, 2 or 3
-
are symlinked to SCG-html-agent-<rel>.log
where <rel> = older, yesterday
or today.
/home/hgs/perlproc/check-monitor-health, a
script under cron, uses the logs to decide whether a restart of
the agent is required.