import os

# This try/except block will make this compatible with any Agent version
try:
    # first, try to import the base class from new versions of the Agent...
    from datadog_checks.base import AgentCheck
except ImportError:
    # ...if the above failed, the check is running in Agent version < 6.6.0
    from checks import AgentCheck


# content of the special variable __version__ is shown in the Agent status page
__version__ = "1.0.0"

TAGS = <%= @tags %>
MOUNTS = ['rip_assets_video', 'ripped_assets']


class DaemonVideoMountCheck(AgentCheck):
    def check(self, instance):
        for mount in MOUNTS:
            value = int(os.path.isfile('/mnt/{}/drive_status'.format(mount)))
            self.gauge('mount.{}.available'.format(mount), value, tags=TAGS)
