[Xymon] Detecting read-only file system in Linux

Benjamin Smith lists at benjamindsmith.com
Tue Mar 10 01:58:05 CET 2015


On Monday, March 09, 2015 12:44:03 PM SebA wrote:
> Hi,
> 
> I have been trying to find out if there is a way of Xymon detecting that a
> file-system in Linux has gone read-only as a result of a disk error (other
> than reporting it just the once via monitoring /var/log/messages).  Nothing
> is showing up in my Xymon server, but my xymon-client is a bit old:
> xymon-client-4.3.7-26.1.el5.tnt

Looking to solve more/less the same problem, we went a different way. When you 
run fscheck on an unmounted filesystem, you'll see an immediate message like 
"Filesystem has errors..." and you can access that bit even when the filesystem 
is mounted. 

Here's a code snippet for ext2/3/4: 

/sbin/debugfs -R "show_super_stats -h " /dev/sda1 2>&1 | /bin/grep -i 
"Filesystem state"

I've wrapped this into an "fscheck.sh" script that I run on all my servers to 
catch errors tracked by the file system, the fscheck script is now hundreds of 
lines long and traps F/S errors for several different file system types. (EG: 
ZFS)

-Ben 





More information about the Xymon mailing list