[hobbit] Disk Usage Sorting

Henrik Stoerner henrik at hswn.dk
Fri Aug 4 18:37:33 CEST 2006


On Fri, Aug 04, 2006 at 12:14:49PM -0400, Camp, Neil D. (ManTech) CTR wrote:
> If I wanted to sort my disk usage by highest offender first, how would I
> change the display to show that? Thanks.
> 
> Example
> 
> Filesystem          1024-blocks  Used  Available Capacity Mounted on
> /dev/MAIN/Usr         1625002  1423491   201511    88%   /usr
> /dev/MAIN/Home        523910   458737    65173    88%   /home
> /dev/MAIN/Opt         2025176  1664282   360894    83%   /opt
> /dev/MAIN/Root        300769   142019   158750    48%   /
> /dev/MAIN/Stand       272812    48284   224528    18%   /stand
> /dev/MAIN/Var         1556049   235055  1320994    16%   /var
> /dev/MAIN/Tmp         491827     1987   489840     1%   /tmp

The easiest - at least for me - would be to change the "df" command
being run from the client script to do the sorting. E.g. send the "df"
output through "| tail +2 | sort -nr -k 5" and add a command before the
current "df" command to just output the header line: "df|head -1"


Regards,
Henrik




More information about the Xymon mailing list