View Single Post
Posts: 2,014 | Thanked: 1,581 times | Joined on Sep 2009
#6
Originally Posted by No!No!No!Yes! View Post
Here is the Normal version of the "Rootfs(%):" command:
Code:
df | awk '$1 == "rootfs" {print $5}'
Here is the equivalent Beeconified version of the "Rootfs(%):" command which you can replace:
Code:
df | awk 'BEGIN { FS="[ %]+" } $1 == "rootfs" { print $5 "%"; if ($5 < 90) exit 0; else if ($5 < 95) exit 1; else exit 2 }'
With the beeconified version of the command, the awk statement will return:

Exit Status 0 (Green Beecon) for less the 90% rootfs file system full
Exit Status 1 (Yellow Beecon) for less the 95% rootfs file system full
Exit Status 2 (Red Beecon) for 95% or more rootfs file system full
Very cool - One imagines this can be applied to pretty much any % based command.
__________________
Class .. : Power Poster, Potential Coder
Humor .. : [*********] Alignment: Chaotic Evil
Patience : [***-------] Weapon(s): +2 Logic Mace
Agro ... : |*****-----] Relic(s) : G1, N900