[Xymon] Ignoring file system when two "/" (root partitions) are reported
Bill Arlofski
waa-hobbitml at revpol.com
Wed Sep 14 19:01:54 CEST 2011
> On 09/13/11 14:40, Larry Barber wrote:
>> Could you insert a "grep -v rootfs" in the 'df' section of
>> xymonclient-linus.sh?
Hi Larry... Just a follow-up:
This quick fix solution did work, however there are two things to consider here:
First, it needs to be done manually on every single client which reports the
rootfs and /dev/root devices.
And second, and even more important is that Interestingly enough, the
$EXCLUDES variable manually evaluates to include '-x rootfs' so it should
ALREADY be excluded in the df command and the "grep -v rootfs" should not be
necessary.
See below:
When run manually the rootfs is not included in the output of the df command:
Get EXCLUDES:
$ cat /proc/filesystems | grep nodev | awk '{print $2}' | xargs echo \
| sed -e 's! ! -x !g'
returns: (on one line of course)
sysfs -x rootfs -x bdev -x proc -x tmpfs -x debugfs -x sockfs -x pipefs -x
anon_inodefs -x rpc_pipefs -x devpts -x ramfs -x hugetlbfs -x nfs -x nfsd -x
autofs -x mqueue -x vmblock
Notice that -x rootfs is in that list
so appending that list to the df command where the $EXCLUDES variable would be
evaluated like so:
df -Pl -x iso9660 -x sysfs -x rootfs -x bdev -x proc -x tmpfs -x debugfs -x
sockfs -x usbfs -x pipefs -x anon_inodefs -x rpc_pipefs -x devpts -x ramfs -x
hugetlbfs -x nfs -x nfs4 -x nfsd -x autofs
I get:
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/root 30336296 20486696 8308568 72% /
/dev/hda1 241116 97737 130931 43% /boot
/dev/mapper/VolGroup0-Opt 5242716 698268 4544448 14% /opt
(and a few others that are properly reported but would wrap horribly here)
Where a straight forward df -Pl of course shows the rootfs filesystem:
$ df -Pl
Filesystem 1024-blocks Used Available Capacity Mounted on
rootfs 30336296 20486884 8308380 72% /
/dev/root 30336296 20486884 8308380 72% /
rc-svcdir 1024 136 888 14% /lib64/rc/init.d
udev 10240 188 10052 2% /dev
shm 2032040 0 2032040 0% /dev/shm
/dev/hda1 241116 97737 130931 43% /boot
/dev/mapper/VolGroup0-Opt 5242716 698268 4544448 14% /opt
(and a few others that are properly reported but would wrap horribly here)
Perhaps when the $EXCLUDES variable is evaluated by xymon, it does not propery
include the "-x rootfs" entry in the list, BUT the manual output listed above
is the same on two machines when run as any normal user or the xymon user so I
am not sure where the breakdown is...
--
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
More information about the Xymon
mailing list