6 sed 's/&/\&/g ; s/</\</g ; s/>/\>/g' < $f
10 SGMONDIR="$(dirname "$(realpath -- "$0")")"
12 probes="$("$SGMONDIR"/probelist.sh)"
15 trap "rm -fr $gut $bad" HUP PIPE INT QUIT TERM EXIT
18 <html><head><title>sgmon status $(date -Iseconds)</title></head><body>
20 <tr><th>Status</th><th>Probe</th><th>Last</th><th>Message</th></tr>
22 for probe in $probes ; do
23 if [ -s $probe/state/attempts ] ; then
24 read attempts < $probe/state/attempts || attempts=1
25 mtime=$(stat -t "%F %T" -f %Sm $probe/state/attempts)
26 [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=1
27 [ "$attempts" -lt "$max_attempts" ] &&
28 status="<b>Prefail</b>" || status="<b>FAIL</b>"
29 status="$status (${attempts}/${max_attempts})"
32 if [ -r $probe/state/ok ] ; then
33 mtime=$(stat -t "%F %T" -f %Sm $probe/state/ok)
44 <td><tt><a name="$probe">$probe</a></tt></td>
45 <td><tt>$mtime</tt></td>
46 <td><pre>$(catfiles $probe/state/stdout $probe/state/stderr)</pre></td>
51 echo "</table></body></html>"