Ad Widget

Collapse

Looking for a way to monitor filesystem for "read only"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agentguerry
    Member
    • Jul 2009
    • 45

    #1

    Looking for a way to monitor filesystem for "read only"

    Hi all,

    Does anyone have a clue on a way to use zabbix agents to monitor if a filesystem (linux) has slipped into "read-only" state?

    Thank you,

    L
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    in a really simple way you could add a userparameter like this :

    Code:
    UserParameter=vfs.mount.status[*],mount | grep "on $$1 "
    then on the item you could use regexp() function to check for occurrence of "(.*ro.*)" or similar.

    that would store in the db full mountpoint line, so you might also want to rewrite it so that only 1/0 is returned depending on ro/rw status. on the other hand, storing full line might allow to monitor other aspects (atime, acl and whatever other flags you might be interested in)
    Zabbix 3.0 Network Monitoring book

    Comment

    • MrKen
      Senior Member
      • Oct 2008
      • 652

      #3
      I have experienced this exact problem where a mounted partition has for some reason become unmounted, then has remounted itself as 'read only'.

      For me the solution was to monitor the log file, searching for the word 'Remounting'. This was tested and works fine. Then added a trigger called 'File System changed to Read Only'.

      Item.
      Type: Zabbix Agent (active)
      Key: log[/var/log/messages,Remounting]
      Type of Information: log

      Trigger.
      {MyHost:log[/var/log/messages,Remounting].nodata(30)}#1

      * You will need to check your logs for an appropriate word or phrase, maybe Remounting is not right for your situation.

      MrKen
      Disclaimer: All of the above is pure speculation.

      Comment

      • LenR
        Senior Member
        • Sep 2009
        • 1005

        #4
        Are you having VMware disks going read only? We do occasionally and I don't think the Linux mount status changes, it acts like a hardware error. You could use touch to create a file then test if it's there, if not, it's bad.

        Comment

        Working...