Created
May 5, 2015 15:43
-
-
Save ChangedNameTo/aacac05109d3959b6032 to your computer and use it in GitHub Desktop.
Uptime Counter for Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "<head><title>Uptime</title></head><body><center><b>The server has been up for:<br><h1> " > /var/www/html/up.html ; top -b -n 1 | head -1 | grep -E -o ".{0,3}days" >> /var/www/html/up.html ; echo "</h1></b><br><hr><h3>Other Stats</h3><br><b>" >> /var/www/html/up.html ; top -b -n 1 | head -1 | grep -E -o "load average.{0,18}">> /var/www/html/up.html ; echo "<br> Disk space used: " >> /var/www/html/up.html ; df -h | sed -n 2p | cut -d " " -f 13 >> /var/www/html/up.html ; echo "</b><br><small>Last updated on `date`</small></center></body>" >> /var/www/html/up.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment