Skip to content

Commit

Permalink
Update ruptime.cgi
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmyczko authored Oct 28, 2024
1 parent d08d3ea commit 92213c2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions web/ruptime.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ for a in $(grep ruptime /usr/bin/ruptime |head -1 |sed "s,.*in ,,;s,;.*,,"); do
done
cat << TOPRIGHT
<div class="topright">
<a href="?query=network">network</a>
<a href="?query=stats">stats</a>
</div>
TOPRIGHT
Expand All @@ -63,4 +64,26 @@ cat << BOTTOMRIGHT
BOTTOMRIGHT
echo "<pre>"
$run
if [ "$sel" = "network" ]; then
d=$(hostname -d)
echo Network information for $d
host -t soa $d
host -t ns $d
host -t mx $d
whois $(host $(hostname -d) | awk '{print $NF}'|head -1)|grep CIDR
fi
if [ "$sel" = "stats" ]; then
#echo MOO
down=$(ruptime|grep down$|wc -l)
up=$(ruptime|grep -v down$|wc -l)
total=$(ruptime|wc -l)

echo Hosts without GPU $(rload |awk '{if (NF!=5) print}'|wc -l)
echo Hosts with GPU $(rload |awk '{if (NF==5) print}'|wc -l)

echo Total cores $(rhw |awk '{print $4}'|datamash sum 1)
echo Total memory in GB $(rhw |awk '{print $5}'|datamash sum 1)

echo Hosts up/Total hosts [$up/$total]
fi
echo "<br>"

0 comments on commit 92213c2

Please sign in to comment.