Xymon Mailing List Archive search

df -h

list Scott Pfister
Wed, 10 Dec 2014 18:51:21 -0500
Message-Id: <CAKGNuPecFU6bfhfS_1bGR14=8kaueW=AayF=WVs1hZh3o=user-cb26df2f7f63@xymon.invalid>

The xymonclient-darwin.sh the xymonclient-freebsd.sh makes use of df -H out
of the box. The disk graph is based on capacity %used.  df -k or df-H
display the % used. so changing from one to the other should not impact the
graphs.  We tried this on another host and df -k or df -h displays the
columns differently and I recall having to change the [df] sed stanza to
make it display correctly.  I  don't recall the exact steps and we never
went further than the one test host. .

indespd1:bin root# df -h
Filesystem      Size   Used  Avail Capacity  Mounted on
/dev/disk0s2    27Gi   13Gi   14Gi    48%    /
devfs          190Ki  190Ki    0Bi   100%    /dev
/dev/disk0s4    61Gi  7.1Gi   53Gi    12%    /Users
/dev/disk0s5    37Gi  6.6Gi   31Gi    18%    /Applications
/dev/disk0s6   432Gi   22Gi  410Gi     6%    /Images
/dev/disk0s7   373Gi   12Gi  360Gi     4%    /Data
/dev/disk2s2   4.0Ti  3.2Ti  864Gi    79%    /Volumes/Macdata
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home
map -fstab       0Bi    0Bi    0Bi   100%    /Network/Servers
/dev/disk1      39Mi   28Mi   12Mi    71%    /Volumes/ConfigTool 4.17
indespd1:bin root# df -H
Filesystem      Size   Used  Avail Capacity  Mounted on
/dev/disk0s2     29G    14G    15G    48%    /
devfs           194k   194k     0B   100%    /dev
/dev/disk0s4     65G   7.6G    57G    12%    /Users
/dev/disk0s5     40G   7.1G    33G    18%    /Applications
/dev/disk0s6    464G    24G   440G     6%    /Images
/dev/disk0s7    400G    13G   387G     4%    /Data
/dev/disk2s2    4.4T   3.5T   928G    79%    /Volumes/Macdata
map -hosts        0B     0B     0B   100%    /net
map auto_home     0B     0B     0B   100%    /home
map -fstab        0B     0B     0B   100%    /Network/Servers
/dev/disk1       41M    29M    12M    71%    /Volumes/ConfigTool 4.17
indespd1:bin root# df -k
Filesystem    1024-blocks       Used Available Capacity  Mounted on
/dev/disk0s2     28793176   13499372  15037804    48%    /
devfs                 189        189         0   100%    /dev
/dev/disk0s4     63476564    7412180  56064384    12%    /Users
/dev/disk0s5     39062500    6889736  32172764    18%    /Applications
/dev/disk0s6    453125000   22965716 430159284     6%    /Images
/dev/disk0s7    390744108   12832232 377911876     4%    /Data
/dev/disk2s2   4294631384 3388796832 905834552    79%    /Volumes/Macdata
map -hosts              0          0         0   100%    /net
map auto_home           0          0         0   100%    /home
map -fstab              0          0         0   100%    /Network/Servers
/dev/disk1          40000      28200     11800    71%
/Volumes/ConfigTool 4.17

On Wed, Dec 10, 2014 at 4:17 PM, Vernon Everett <user-b3f8dacb72c8@xymon.invalid>
wrote:
I recall making this change some time back, and there was a problem with
something, can't remember what, but I eventually changed it back.
But that was also many versions ago, probably version 3.something.
It may just work now, and worth a try.
Please let us know the results.

If it's the alpha component people are worried about, manipulating the
data isn't difficult though.
Something similar to this will do the trick.

toByte()
{
    OUTPUT=$1
    DENOM=$(echo $OUTPUT | sed -e "s/^.*\(.\)$/\1/")
    NUMBER=$(echo $OUTPUT | sed "s/.$//")
    [ "$DENOM" = "K" ] && OUTPUT=$(echo "$NUMBER*1024" | bc)
    [ "$DENOM" = "M" ] && OUTPUT=$(echo "$NUMBER*1024*1024" | bc)
    [ "$DENOM" = "G" ] && OUTPUT=$(echo "$NUMBER*1024*1024*1024" | bc)
    [ "$DENOM" = "T" ] && OUTPUT=$(echo "$NUMBER*1024*1024*1024*1024" | bc)
    echo $OUTPUT
}


On 11 December 2014 at 03:19, Nick Pettefar <user-2027539dd102@xymon.invalid> wrote:
The graphs still work, I believe the df -h is just for the web page
display.

The Disk and Trends graphs still show the same values after the -h
change on our systems.

Regards,

Nick Pettefar


On 10 December 2014 at 19:13, Galen Johnson <user-fc632e705d24@xymon.invalid> wrote:
Also, df -k is numeric...df -h is alphanumeric and would require
additional
manipulation to graph.
--
"Accept the challenges so that you can feel the exhilaration of victory"
- General George Patton