Ad Widget

Collapse

Monitor Other User Mount Point

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thefuzz4
    Junior Member
    • Feb 2015
    • 16

    #1

    Monitor Other User Mount Point

    So I have an amazon cloud drive account and I'm using the acd_cli to mount the drive under a user. So naturally only this user can see this mount. Heck even root can't see the mount.

    So how would one go about monitor this mount point. I have times where the mount becomes unresponsive and requires a little bit of love in order for it to come back online and I would like to just automate that instead having to do manual intervention. Thank you all in advance for your help with this.
  • zalums
    Junior Member
    • May 2016
    • 8

    #2
    Hi,

    I personally don`t have a Amazon Cloud drive so my question is just out of nowhere, but:

    Is there any log file which writes state of mounted drive? if yes, then could monitor that for specific lines.

    Comment

    • LenR
      Senior Member
      • Sep 2009
      • 1007

      #3
      How does the user know the state of the mounted filesystem?

      Maybe cron a script that uses sudo as that user to touch a file on the mount? Send the result to Zabbix with zabbix_sender. It might hang if it fails, so I'd add a nodata() check and a dependency on host availability.

      Comment

      • thefuzz4
        Junior Member
        • Feb 2015
        • 16

        #4
        Zalimus there is but sometimes the errors that I'm catching already with splunk are actually false.

        LenR I think that you have the right idea with that so I'll go investigate how to construct that for zabbix_sender and get it completed. Thanks.

        Comment

        • thefuzz4
          Junior Member
          • Feb 2015
          • 16

          #5
          So after some tweaking this is what I came up with in case anyone else wants to use it

          Code:
          #!/bin/bash
          
          ######################
          #acd_cli check script#
          #Written by thefuzz4 #
          # 06/19/2016         #
          ######################
          
          HOSTNAME=yourhostgoeshere
          CONFIG=/etc/zabbix/zabbix_agentd.conf
          
          
          if ! timeout 10s touch ~/acd-sorted/test ; then
          #If we're not able to touch the file then lets just quit now and tell zabbix we died
            zabbix_sender -c ${CONFIG} -s ${HOSTNAME} -k mount.acd_cli -o 0 #> /dev/null
            exit 0
          fi
          #We touched it so lets tell zabbix that we're ok and delete the file
          zabbix_sender -c ${CONFIG} -s ${HOSTNAME} -k mount.acd_cli -o 1 #> /dev/null
          rm ~/.acd-sorted/test
          exit 0
          Then on zabbix I have a trigger action to unmount the mount, delete the nodes.db file, do a fresh sync and then mount the file system back up. I might end up putting the commands into a script and just let zabbix call the script instead, but for now its working like it should.

          Comment

          Working...