[UPDATE] add web server python
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
PrintRes() {
|
||||
|
||||
echo "$1"
|
||||
|
||||
}
|
||||
|
||||
PrintWeb() {
|
||||
|
||||
if [ ! -f /tmp/webmonithor ]
|
||||
then
|
||||
echo '
|
||||
<html>
|
||||
<head>
|
||||
<title>MoniThor on '${RemoteIp}' </title>
|
||||
<meta http-equiv="refresh" content="'${Rotation}'" />
|
||||
</head>
|
||||
|
||||
Date : '$(date +'%Y-%m-%d %H:%M:%S')'
|
||||
|
||||
<table border="1" color="#FFFFFF">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">MoniThor Result</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
' > /tmp/webmonithor
|
||||
|
||||
fi
|
||||
|
||||
if [ "$1" == "END_DNE" ]
|
||||
then
|
||||
echo '
|
||||
|
||||
</tbody>
|
||||
</table> ' >> /tmp/webmonithor
|
||||
mv /tmp/webmonithor ../web/index.html
|
||||
|
||||
else
|
||||
|
||||
Val=$(echo $1 | cut -d"|" -f1)
|
||||
Txt=$(echo $1 | cut -d"|" -f2)
|
||||
Sonde=$2
|
||||
Arg=$3
|
||||
Color=red
|
||||
[[ $Val == "0" ]] && Color=green
|
||||
[[ $Val == "1" ]] && Color=yellow
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td>'$Sonde'</td>
|
||||
<td>'$Arg'</td>
|
||||
<td style="background-color:'${Color}';" > '$Val' </td>
|
||||
<td> '$Txt'</td>
|
||||
</tr>' >> /tmp/webmonithor
|
||||
fi
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user