[Xymon] Graphing a disk-like check
Phil Crooker
Phil.Crooker at orix.com.au
Sun Feb 12 23:43:54 CET 2017
Nice hack with changing the definition of df. I normally just create a specific test - I just have to watch that there aren't too many tests for display on the webpage. I like your technique - much cleaner.
I don't think breaks the intent of xymon at all - those OS-level definitions are there so they can be easily modified. Much better than having to change the OS side!
________________________________
Subject: Re: [Xymon] Graphing a disk-like check
You're on the right track with the graphs.cfg and xymonserver.cfg
Your data has to be transmitted from the client as NCV, though. Each data point has to be sent on a line by itself in "name-colon-value" format.
Your message should look something like this:
data HOSTNAME.TESTNAME
blocks_used:3333333
blocks_available:4444444
blocks_size:7777777
See the manpage for the xymon command to send a "data" message": https://www.xymon.com/help/howtograph.html
Go back and read the "Custom Graph" help page, too... https://www.xymon.com/help/howtograph.html
Read all the way to the bottom and pay attention to how to send "trends" data directly into a specific RRD file. That might be particularly helpful; I might even change a few of my custom data scripts based on that.
As an aside note... if it were me doing this-- trying to graph additional disk data-- I would modify the OS specific client script (e.g. /home/xymon/client/bin/xymonclient-linux.sh) to include the NFS file system you interested in graphing. Find where it executes "df -P" and replace that with a custom script, e.g. /home/xymon/client/ext/custom_df.sh
In a normal client message, you'll see something like this:
[df]
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/mapper/vgroot-lvroot 774064 506600 228148 69% /
/dev/sda1 126931 91273 29105 76% /boot
/dev/mapper/vgroot-lvhome 516040 17536 472292 4% /home
/dev/mapper/vgroot-lvopt 2064208 631884 1327468 33% /opt
/dev/mapper/vgroot-lvtmp 2064208 95144 1864208 5% /tmp
/dev/mapper/vgroot-lvusr 4902544 4284596 368924 93% /usr
/dev/mapper/vgroot-lvusrloc 1032088 95692 883968 10% /usr/local
/dev/mapper/vgroot-lvvar 10321208 6985600 2811424 72% /var
[inode]
Here's what that looks like in code:
echo "[df]"
EXCLUDES=`cat /proc/filesystems | grep nodev | grep -v rootfs | awk '{print $2}' | xargs echo | sed -e 's! ! -x !g'`
ROOTFS=`readlink -m /dev/root`
df -Pl -x iso9660 -x $EXCLUDES | sed -e '/^[^ ][^ ]*$/{
N
s/[ ]*\n[ ]*/ /
}' -e "s&^rootfs&${ROOTFS}&"
echo "[inode]"
Modify the code so it will give you the results you're expecting, to include your NFS filesystem. If the line is there, it will be graphed just like the rest of them
[df]
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/mapper/vgroot-lvroot 774064 506600 228148 69% /
/dev/sda1 126931 91273 29105 76% /boot
/dev/mapper/vgroot-lvhome 516040 17536 472292 4% /home
/dev/mapper/vgroot-lvopt 2064208 631884 1327468 33% /opt
/dev/mapper/vgroot-lvtmp 2064208 95144 1864208 5% /tmp
/dev/mapper/vgroot-lvusr 4902544 4284596 368924 93% /usr
/dev/mapper/vgroot-lvusrloc 1032088 95692 883968 10% /usr/local
/dev/mapper/vgroot-lvvar 10321208 6985600 2811424 72% /var
nfs-server:/NFS01 13260711552 11019471040 2241240512 84% /nfs01
[inode]
I know. I know. This probably REALLY violates standard Xymon practices. It certainly does add potential problems and maintenance headaches down the road when you upgrade, but it is certainly the shortest path to tracking your disk. I've made a number of modifications to my OS specific scripts in my environment over the years. When I upgrade, I diff the originals. If they're the same, I simply drop in my custom script. If not, I have all the changes documented at the top of my custom script so I can find them easier.
Good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20170212/770cb258/attachment.html>
More information about the Xymon
mailing list