[PATCH] Broken disk usage reports on newer MacOS X versions, filling up server's rrd directory
Hi, since at least MacOS X 10.9 (current is 10.10) and maybe even with MacOS X 10.8(*), MacOS X's "df" by default outputs additional columns with inodes usage before printing the mount point: # df -H / Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1 250G 151G 99G 61% 36870372 24110874 60% / This causes Xymon servers to interpret the number of used inodes as mountpoint, hence creating a new RRD upon nearly every client report: # ls -l /var/lib/xymon/rrd/igor | head total 390080 -rw-r--r-- 1 xymon xymon 19640 Jun 5 11:56 clock.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:12 disk10022397.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:27 disk10068502.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:17 disk10068636.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:22 disk10068638.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:32 disk10068891.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:37 disk10069129.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:42 disk10069573.rrd -rw-r--r-- 1 xymon xymon 38624 Apr 17 16:47 disk10069927.rrd # ls -l /var/lib/xymon/rrd/igor | wc -l 9752 # du -sh /var/lib/xymon/rrd/igor 382M /var/lib/xymon/rrd/igor # The fix is to use the -P in addition to -H or -i. Following is a patch against 4.3.21: diff --git a/client/xymonclient-darwin.sh b/client/xymonclient-darwin.sh index 9a4f45a..da6c265 100755 --- a/client/xymonclient-darwin.sh +++ b/client/xymonclient-darwin.sh @@ -29,19 +29,19 @@ who FILESYSTEMS=`mount | grep -v nobrowse | awk '{print $3}'` echo "[df]" set $FILESYSTEMS -(df -H $1; shift +(df -P -H $1; shift while test $# -gt 0 do - df -H $1 | tail -1 + df -P -H $1 | tail -1 shift done) | column -t -s " " | sed -e 's!Mounted *on!Mounted on!' echo "[inode]" set $FILESYSTEMS -(df -i $1; shift +(df -P -i $1; shift while test $# -gt 0 do - df -H $1 | tail -1 + df -P -H $1 | tail -1 shift done) | awk ' NR<2{printf "%-20s %10s %10s %10s %10s %s\n", $1, "itotal", $6, $7, $8, $9} HTH and would be nice if this patch could make it into 4.3.22. (*) I only have access to machines running MacOS X 10.10, 10.9, 10.7 and 10.6, so I couldn't test 10.8. And 10.7 as well as 10.6 don't have that issue. Kind regards, Axel Beckert -- Axel Beckert <beckert at phys.ethz.ch> support: +41 44 633 26 68 IT Services Group, HPT H 6 voice: +41 44 633 41 89 Departement of Physics, ETH Zurich CH-8093 Zurich, Switzerland http://nic.phys.ethz.ch/
participants (1)
-
beckert@phys.ethz.ch