Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Sample output:
- #
- # Server Uptime ...................... 185.27 Days
- # Storage Space Used ................. 24.6% (48.87 of 149.50 GiB)
- # Server RAM Used .................... 27.5% (554.59 of 2013.97 MiB)
- # Recent CPU Load .................... 0.0% (15 Min Average: 0.0%)
- # Current Processes .................. 182
- # Total processes since boot ......... 6,386,390
- # Code to add to /etc/profile or similar
- #
- awk '{ printf "Server Uptime ...................... %.2f Days\n", ($1/60/60/24) }' '/proc/uptime'
- df '--portability' '--block-size=1' '/' | \
- awk "
- /^\// {
- printf \"Storage Space Used ................. %.1f%% (%.2f of %.2f GiB)\n\",
- (\$3*100/\$2),
- (\$3/1024/1024/1024),
- (\$4/1024/1024/1024)
- }
- " # End awk
- { free -k | tr '\n' ' '; echo; } |\
- awk "
- {
- printf \"Server RAM Used .................... %.1f%% (%.2f of %.2f MiB)\n\",
- (\$16*100/\$8),
- (\$16/1024),
- (\$8/1024)
- }
- " # End awk
- awk '
- {
- printf "Recent CPU Load .................... %.1f%% (15 Min Average: %.1f%%)\n",
- ($1*100/4),
- ($3*100/4)
- }' '/proc/loadavg'
- sed -e 's+.*[0-9]*/+Current Processes .................. +; s+ [^ ]*$++' '/proc/loadavg'
- LC_ALL='en_US.UTF-8' gawk "
- /processes/ {
- printf \"Total processes since boot ......... %'.0f\n\n\", \$2
- }" '/proc/stat'
Add Comment
Please, Sign In to add comment