<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16609"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015>Hi,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>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: </SPAN></FONT><FONT size=2
face=Arial><SPAN
class=298451712-09032015>xymon-client-4.3.7-26.1.el5.tnt</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>I did a bit of
Googling and I came up with these two links that may be
relevant:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015><A
href="http://sisyphus.ru/en/srpm/Sisyphus/xymon/sources/8">http://sisyphus.ru/en/srpm/Sisyphus/xymon/sources/8</A></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015><A
href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764197">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764197</A></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>It seems that a RPM
maintainer may have made some modifications to their version in order to catch
disks in a read-only state (in the first link) and that there is mount-ro plugin
that is part of the hobbit-plugins package in Debian / Ubuntu. Does anyone
have more information on either of these and whether any patches can be
integrated upstream or plug-ins added to xymonton? CCing Axel Beckert as
he seems to have committed something to the mount-ro plugin recently:
</SPAN></FONT><FONT size=2 face=Arial><SPAN class=298451712-09032015><A
href="https://www.openhub.net/p/hobbit-plugins/commits">https://www.openhub.net/p/hobbit-plugins/commits</A></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>Although we have
some Debian systems, I was looking for a solution for another Linux
distro.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=298451712-09032015></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>If I was to write
something myself to do it, I would check /proc/mounts and the best command I
could find was:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>awk
'$4~/(^|,)ro($|,)/' /proc/mounts<BR>which outputs:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>/dev/root / ext3
ro,data=ordered 0 0</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>with sample
line:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=298451712-09032015>/dev/root / ext3
ro,data=ordered 0 0<BR></SPAN></FONT></DIV>
<DIV><SPAN class=298451712-09032015></SPAN><SPAN style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"><SPAN
class=298451712-09032015><FONT size=2>This command also produced a nice summary
output that might be good to have on a Xymon status
page:</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"><SPAN
class=298451712-09032015><FONT size=2>cat /proc/mounts|sort|awk '{print $1
"\011" toupper(substr($4,0,2)</FONT><BR></SPAN></SPAN></SPAN><SPAN
style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"></SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"><SPAN
class=298451712-09032015><FONT size=2>The following was at the bottom of
/var/log/messages, but it does not suggest any very obvious alarm strings to add
other than the last line without the 'dm-0', but it would be nicer to have
something more generic still as textual messages can change between different
versions of the O/S.</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"><SPAN
class=298451712-09032015><FONT size=2></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN style="FONT-SIZE: 12px"><SPAN
style="FONT-FAMILY: arial,helvetica,sans-serif"><SPAN
class=298451712-09032015><FONT size=2>kernel: sd 0:0:0:0: Unhandled sense
code<BR>kernel: sd 0:0:0:0: SCSI error: return code = 0x08100002<BR>kernel:
Result: hostbyte=invalid driverbyte=DRIVER_SENSE,SUGGEST_OK<BR>kernel: sda:
Current: sense key: Hardware Error<BR>kernel: Add. Sense:
Defect list error<BR>kernel:<BR>kernel: Buffer I/O error on device dm-0, logical
block 1358756<BR>kernel: lost page write due to I/O error on
dm-0<BR></FONT></SPAN></DIV>
<DIV><FONT size=2></FONT><BR>Kind regards,<BR><BR>Seb<SPAN
class=298451712-09032015>A</SPAN><BR></DIV></SPAN></SPAN>
<DIV><FONT size=2 face=Arial></FONT> </DIV></BODY></HTML>