Ad Widget

Collapse

Monitor NFS mount

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pchelkin
    Junior Member
    • May 2016
    • 18

    #1

    Monitor NFS mount

    Hi all,
    Technically /archive is zfs pool shared over NFS and mounted to all our hosts.
    Sometimes happens that /archive become unavailable on one particular host or all of them. We need to trace this accidents by monitoring /archive availability on each of this hosts.
    I would like to check if a given NFS mount is still in good shape.
    Any ideas?
  • lpkone
    Member
    • May 2015
    • 56

    #2
    UserParameter=nfs.check[*], if [[ `timeout 5 ls $1` ]]; then echo 1; else echo 0; fi

    Comment

    • sadman
      Senior Member
      • Dec 2010
      • 1611

      #3
      Originally posted by lpkone
      UserParameter=nfs.check[*], if [[ `timeout 5 ls $1` ]]; then echo 1; else echo 0; fi
      На дебиане, например, этот однострочник имеет шанс вывалится с ошибкой. Потому что UserParameter запускается из под Zabbix-а через sh, а [[ - это bash.

      Comment

      • Pchelkin
        Junior Member
        • May 2016
        • 18

        #4
        Originally posted by lpkone
        userparameter=nfs.check[*], if [[ `timeout 5 ls $1` ]]; then echo 1; else echo 0; fi
        Проверено. Работает. Спасибо, тему можно закрыть.

        Comment

        Working...