- marked as minor
Fix for a filesystem statistic error
Hello Tildeslash,
customer systems (Linux SLES 11/12 with monit 5.26.0/5.25.2) does not collect the disk statistic well in the past. The disk usage data will collected, but the disk activity data will not.
The "monit.log" file contain sometime some error messages:
[CET Mar 19 15:03:27] error : filesystem statistic error: cannot read /sys/class/block/as12345avol/stat -- No such file or directory [CET Mar 19 15:47:33] error : filesystem statistic error: cannot read /sys/class/block/as12345avol/stat -- No such file or directory [CET Mar 19 15:53:33] error : filesystem statistic error: cannot read /sys/class/block/as12345avol/stat -- No such file or directory
"monit -I -vv" give some usefull information also:
Reloading mount information for filesystem '/opt/as12345a' filesystem statistic error: cannot read /sys/class/block/as12345avol/stat -- No such file or directory
"df -T" give the following information:
Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/vx/dsk/as12345dg/as12345avol vxfs 52328448 5795415 43628907 12% /usd/as12345a
"ls -la" shows the following:
brw------- 1 root root 199, 20001 Apr 14 2019 /dev/vx/dsk/as12345dg/as12345avol
With "cat /proc/diskstats | grep 20001" I got:
199 20001 VxVM20001 567479 0 6640784 449048 37475 1 169389 1604 0 314528 450084
And (more easy to handle and faster) with “cat /sys/dev/block/199:20001/stat" I got:
567479 0 6640784 449048 37475 1 169389 1604 0 314528 450084
Based on this information I patched the src/device/sysdep_LINUX.c file (I append a unified diff file to patch the sources) and build monit. Monit handle the "vxfs" (Veritas filesystem) correctly, now.
Feel free to use my patch, it is a suggestion only,
with regards,
Lutz
p.s.
The patch reads the activity statistic data from the sysfs and the procfs based on the device major and minor number, but I think reading sysfs works well and is more easy.
Maybe I will remove reading the procfs data in the future, my patch file (vxfs-src-monit-5.26.0.diff) contain the whole patch I used for "src/device/sysdep_LINUX.c".
Comments (10)
-
reporter -
reporter Nice to see,
without the fix it looked like this.Filesystem 'Dienst_Fs' status OK monitoring status Monitored monitoring mode active on reboot start filesystem type vxfs filesystem flags rw,delaylog,largefiles,ioerror=mwdisable permission 755 uid 0 gid 0 block size 1 kB space total 400.0 GB (of which 1.9% is reserved for root user) space free for non superuser 113.8 GB [28.4%] space free total 121.2 GB [30.3%] inodes total 31972776 inodes free 31778463 [99.4%] data collected Fri, 31 Jan 2020 09:51:00
And with the fix there is the disk activity data for Veritas Filesystems (vxfs) available, also.
Filesystem 'Dienst_Fs' status OK monitoring status Monitored monitoring mode active on reboot start filesystem type vxfs filesystem flags rw,delaylog,largefiles,ioerror=mwdisable permission 755 uid 0 gid 0 block size 1 kB space total 400.0 GB (of which 1.9% is reserved for root user) space free for non superuser 113.7 GB [28.4%] space free total 121.2 GB [30.3%] inodes total 31955176 inodes free 31760862 [99.4%] read 870.8 B/s [16.1 GB total], 0.1 reads/s [268080 reads total] write 2.4 MB/s [6.3 GB total], 35.6 writes/s [105166 writes total] service time 0.021ms/operation (of which read 0.000ms, write 0.021ms) data collected Fri, 31 Jan 2020 09:54:07
Filesystem status details for a "vxfs" filesystem with the read, write and service time activity statistic data.
With regards,
Lutz -
Looks good! Please make a pull request instead and to accept we must also have the CLA signed.
-
reporter Hello Jan-Henrik,
I try to make a pull request, but it seems to I am not authorized to do this or something is goint wrong. I try to do this via Browser and SourceTree (a tool from Atlassian). I signed the CLA.
Sorry, Lutz
-
To make a PR, first fork the Monit repo. Use Bitbucket to make a branch of your fork and apply your changes. Then in your branches overview on Bitbucket you can create a PR.
-
reporter Hello Jan-Henrik,
I tried to do this, but the pull requests list some more files, I add some changes to src/device/sysdep_LINUX.c only.
See https://bitbucket.org/tildeslash/monit/pull-requests/82
Lutz
-
reporter Hello Jan-Henrik,
I got some help, the new request contain the changed source file only, now.See https://bitbucket.org/tildeslash/monit/pull-requests/83/add-vxfs-statistic-support-for-linux
Sorry, but this is my first experience with a GIT repository,
I used and like SVN in general.Lutz
-
repo owner - changed status to resolved
Fixed: Issue
#877: Add support for VxFS filesystem statistics. Thanks to Lutz Mader for patch. https://bitbucket.org/tildeslash/monit/pull-requests/83/add-vxfs-statistic-support-for-linux/diff→ <<cset 11fca95d3ece>>
-
reporter Hello everybody,
a package with this fix based on 5.26.0 is available now, see https://bitbucket.org/lutzmad/monit/downloads/monit-5.26.0-suse11vxfs-x64.tar.gzI add the support for the VxFS filesystem statistics and for large PIDs (monit procmatch with PIDs up to 8 digits) also, the sources compiled to support SLES 11 (Linux Kernel 3.0, x86_64 only) systems.
Lutz
-
repo owner Hello,
simplified the implementation with this checkin: https://bitbucket.org/tildeslash/monit/commits/7469b8c86d66 (/sys/dev/block/<major>:<minor>/stat is used now by default as using the device name is unreliable even with non-vxfs filesystem under configuration described in
#937and#725) - Log in to comment