Add yearly network statistics and remove text-based hourly statistics

This commit is contained in:
tim 2021-08-19 13:37:47 +09:30
parent ed03c2646e
commit 550f1ee1cb
1 changed files with 4 additions and 4 deletions

View File

@ -20,11 +20,11 @@ webstat () {
echo '<h2>Memory:</h2><pre>'"$(free -h)"'</pre><br>'
echo '<h2>Uptime:</h2><pre>'"$(uptime)"'</pre><br>'
echo '<h2>Network Usage:</h2>'
echo -e "<img src=\"data:image/png;base64,$(vnstati -i $interface1 -m -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface1 -d -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface1 -h -o - | base64 -w0)\">"
echo "<pre>$(vnstat -i $interface1 -h | tail -n 9)</pre>"
echo -e "<img src=\"data:image/png;base64,$(vnstati -i $interface1 -y -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface1 -m -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface1 -d -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface1 -h -o - | base64 -w0)\">"
#echo "<pre>$(vnstat -i $interface1 -h | tail -n 9)</pre>"
if [ ! -z $interface2 ]; then
echo -e "<br><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -m -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -d -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -h -o - | base64 -w0)\">"
echo "<pre>$(vnstat -i $interface2 -h | tail -n 9)</pre>"
echo -e "<img src=\"data:image/png;base64,$(vnstati -i $interface2 -y -o - | base64 -w0)\"><br><br><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -m -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -d -o - | base64 -w0)\"><br><img src=\"data:image/png;base64,$(vnstati -i $interface2 -h -o - | base64 -w0)\">"
#echo "<pre>$(vnstat -i $interface2 -h | tail -n 9)</pre>"
fi
echo '</body></html>'
}