<!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 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV><FONT size=2 face=Arial>
<DIV dir=ltr align=left><SPAN class=532315214-09032015><FONT size=2 
face=Arial>Thanks Thomas. Simulating this suggests your code will work on our 
server, but as you said, you are not 100% sure that the 'ro' will surface in the 
mount command. The output here suggests that it may not:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=532315214-09032015><FONT size=2 
face=Arial><A 
href="http://sisyphus.ru/en/srpm/Sisyphus/xymon/sources/8">http://sisyphus.ru/en/srpm/Sisyphus/xymon/sources/8</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=532315214-09032015><FONT size=3 face=Arial><PRE>#!/bin/sh<BR><BR># Read data from /proc/mounts on linux and report back in the xymon client<BR># It gives more accurate data than the 'mount' command and can catch<BR># disks in a read-only state.<BR><BR>test -r /proc/mounts && exec cat /proc/mounts</PRE></FONT></SPAN></DIV>
<DIV><SPAN class=532315214-09032015>But maybe that is only needed for some other 
version of linux... Our server is now fixed so I can't test it properly. But I 
do prefer a server-side extension, or even a patch to xymon-server, to client 
plugins that I have to install to every server. The issue with your code is that 
it only works for 1 named server ('bb.local'), so I would need to have something 
iterating over all hosts. Probably not hard, and probably something that someone 
here already does...</SPAN></DIV>
<DIV><SPAN class=532315214-09032015></SPAN> </DIV>
<DIV><SPAN class=532315214-09032015>In fact, I think I have found the place to 
add it and that is in this add-on: <A 
href="https://wiki.xymonton.org/doku.php/monitors:check-client">https://wiki.xymonton.org/doku.php/monitors:check-client</A> - 
then it will work for all hosts (correct me if I am wrong David 
Baldwin?)</SPAN></DIV><!-- Converted from text/rtf format -->
<P align=left><SPAN lang=en-gb>Kind regards,</SPAN> </P>
<P><SPAN lang=en-gb>Seb<SPAN 
class=532315214-09032015>A</SPAN></SPAN></P></FONT></DIV><BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px" 
dir=ltr>
  <DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
  <HR tabIndex=-1>
  <FONT size=2 face=Tahoma><B>From:</B> Xymon [mailto:xymon-bounces@xymon.com] 
  <B>On Behalf Of </B>Thomas Eckert<BR><B>Sent:</B> 09 March 2015 
  14:05<BR><B>To:</B> Xymon MailingList<BR><B>Subject:</B> Re: [Xymon] Detecting 
  read-only file system in Linux<BR></FONT><BR></DIV>
  <DIV></DIV>Hi,
  <DIV><BR>
  <DIV>
  <BLOCKQUOTE type="cite">
    <DIV>On 09 Mar 2015, at 13:44, SebA <<A 
    href="mailto:spah@syntec.co.uk">spah@syntec.co.uk</A>> wrote:</DIV>
    <DIV>
    <DIV>
    <DIV></DIV></DIV></DIV></BLOCKQUOTE>
  <DIV><BR></DIV>(…)<BR><BR>
  <BLOCKQUOTE type="cite">
    <DIV>
    <DIV><FONT size=2 face=Arial>Although we have some Debian systems, I was 
    looking for a solution for another Linux distro.</FONT></DIV>
    <DIV><FONT size=2 face=Arial><SPAN 
    class=298451712-09032015></SPAN></FONT> </DIV>
    <DIV><FONT size=2 face=Arial>If I was to write something myself to do it, I 
    would check /proc/mounts and the best command I could find was:</FONT></DIV>
    <DIV><FONT size=2 face=Arial>awk '$4~/(^|,)ro($|,)/' /proc/mounts<BR>which 
    outputs:</FONT></DIV>
    <DIV><FONT size=2 face=Arial>/dev/root / ext3 ro,data=ordered 0 
    0</FONT></DIV>
    <DIV><FONT size=2 face=Arial>with sample line:</FONT></DIV>
    <DIV><FONT size=2 face=Arial>/dev/root / ext3 ro,data=ordered 0 
    0<BR></FONT></DIV></DIV></BLOCKQUOTE>
  <DIV><BR></DIV>
  <DIV>You could use the reported “Client data” / “clientlog” with a server-side 
  extension. I have to admit that I’m not 100% sure if error-or-remounts are 
  reflected properly by this — but `mount` seems to use `/proc/self/mountinfo` 
  as it’s datasource, so it _should_ be ok.</DIV>
  <DIV><BR></DIV>
  <DIV>Extract the reported `mount`-data for host bb.local:</DIV>
  <DIV><BR></DIV>
  <DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>xymon 
  127.0.0.1 “clientlog bb.local section=mount”</DIV>
  <DIV><BR></DIV>
  <DIV>Some testing of the output:</DIV>
  <DIV><BR></DIV>
  <DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>(export 
  host=bb.local; xymon 127.0.0.1:1984 "clientlog $host section=mount" | gawk 
  '/[(,]+ro[,)]+/ { print "filesystem " $1 " mounted RO!" } ')</DIV>
  <DIV><BR></DIV>
  <DIV>This would not require installing and maintaining an extension on every 
  client. One drawback would be increased latency as the ro-check would be 
  “indirect”.</DIV>
  <DIV><BR></DIV>Cheers</DIV>
  <DIV>Thomas</DIV>
  <DIV><BR> </DIV></DIV></BLOCKQUOTE></BODY></HTML>