[CentOS] Resource usage. Was: Headline - Linux misses Windows of opportunity

Mon Oct 3 20:25:52 UTC 2005
Alfred von Campe <alfred at 110.net>

John:

> This is a script I use on all my machines.  Feel free to hack as 
> required.
>
> #!/bin/bash
>
> [snip]
>
> cat /proc/meminfo | grep ^Swap: | awk 'BEGIN {n = 3; d = 4} {total = 
> $2 / 1024 ; used = $3 / 1024; if((total * n) < (used * d
> )) { printf "Swap usage is over %d/%d\n", n, d}}'

Be careful, this will no longer work in CentOS 4 because the format of 
/proc/meminfo has changed.

Alfred