6 sed 's/&/\&/g ; s/</\</g ; s/>/\>/g' < $f
10 SGMONDIR="$(dirname "$(realpath -- "$0")")"
12 probes="$("$SGMONDIR"/probelist.sh)"
15 <html><head><title>sgmon status $(date -Iseconds)</title></head><body>
17 <tr><th>Status</th><th>probe</th><th>Last</th><th>Message</th></tr>
19 for probe in $probes ; do
20 if [ -s $probe/state/attempts ] ; then
21 read attempts < $probe/state/attempts || attempts=1
22 mtime=$(stat -t "%F %T" -f %Sm $probe/state/attempts)
23 [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=1
24 [ "$attempts" -lt "$max_attempts" ] &&
25 status="<b>Prefail</b>" || status="<b>FAIL</b>"
26 status="$status (${attempts}/${max_attempts})"
28 if [ -r $probe/state/ok ] ; then
29 mtime=$(stat -t "%F %T" -f %Sm $probe/state/ok)
39 <td><tt><a name="$probe">$probe</a></tt></td>
40 <td><tt>$mtime</tt></td>
41 <td><pre>$(catfiles $probe/state/stdout $probe/state/stderr)</pre></td>
45 echo "</table></body></html>"