Ad Widget

Collapse

Check mounted filesystem in OSX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • happydan
    Junior Member
    • Aug 2019
    • 2

    #1

    Check mounted filesystem in OSX

    I'm a beginner Zabbix user, so please direct me to a better resource if I'm not in the right place.

    I'd love to monitor if volumes are mounted in Macintosh (OSX).

    For example, the following Bash one liner does the trick (echoes 1 if both are mounted):

    if [ -d /Volumes/Data ] && [ -d /Volumes/Data-BACKUP ] ; then echo 1; else echo 0; fi

    How can I implement a check for this in Zabbix?

    Thanks in advance,

    Dan
  • happydan
    Junior Member
    • Aug 2019
    • 2

    #2
    So I figured this out by exploring custom user parameters. I added the following to the zabbix_agentd.conf file

    UserParameter=userparam.mountedd,if [ -d /Volumes/Data ] ; then echo 1; else echo 0; fi
    UserParameter=userparam.mountedb,if [ -d /Volumes/Data-BACKUP ] ; then echo 1; else echo 0; fi

    Then I created Triggers to alert me if the parameters "userparam.mountedd" or "userparam.mountedb" = 0

    Very cool how this works!

    The following helped me understand how to do these:

    http://www.zabbixbook.com/2017/06/14...serparameters/

    These user parameter "one liners" also helped me understand this feature:

    Join the friendly and open Zabbix community on our forums and social media platforms.

    Comment

    Working...