Ad Widget

Collapse

Zabbix 3.2 monitor if filesystem is mounted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Starko
    Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Aug 2012
    • 93

    #1

    Zabbix 3.2 monitor if filesystem is mounted

    Hello,

    we have several Windows Servers with attached iSCSI drives. Due to Windows beeing stupid, it doesn't reconnect that drives 50% of the time after a reboot.
    I need a check that works like: "vfs.file.exists[file]" but for a whole filesystem or drive letter.

    I could do check like "vfs.file.exists[i:\DO_NOT_DELETE.TXT]" but I think that's the worst solution I could use.

    Somebody has a good idea how to check if the drive is connected?

    Similar case would be with anybody who uses external USB drives or stuff like that.
  • maloz
    Junior Member
    • Feb 2018
    • 10

    #2
    Coming back to this I have the same problem.

    My idead was to check for drive availability in the LLD vfs discovery rule implemented in the Windows OS template.
    Well it turned out that vfs.file.exists[{#FSNAME}] results in vfs.file.exists[C:] and it returned 0.
    Ok, C: is not a file.

    So is there any simple way to check if a drive/mount point is existent or not?

    Comment

    • sancho
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2015
      • 295

      #3
      Hello,
      One way that I found to check if a network drive is mounted, and is not simple, is as follows:

      1º On the host that has the remote unit, I make a .bat that makes a dir of the unit and dumps it to a txt, for example, if the remote unit is the unit I: it would be:
      PHP Code:
      dir i:>c:\i.txt 
      2º On the host that has the remote unit, I configure a scheduled task that executes the .bat every hour.

      3º I prepare an item that checks the file c\i.txt. with an interval hour.

      4º I configure a trigger that activates when the file c:\i.txt is empty.

      A greeting.

      Comment

      • maloz
        Junior Member
        • Feb 2018
        • 10

        #4
        This looks unnecessary complicated.

        How we solved it:
        1. Create UserParameter with following PowerShell command:
        Code:
        UserParameter=check.drive.avail[*],powershell.exe -Command "& {if (Test-Path $1) { echo 1 } else { echo 0 }}"
        2. Create item in FS LLD (we did it in Windows template) using the key
        Code:
        check.drive.avail[{#FSNAME}]
        The item returns 1 if the drive is available and 0 if not.

        3. As a last step create a trigger in the FS LLD which checks for 0/1 of this item.

        Works well and fits our needs.

        Comment

        • sancho
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Mar 2015
          • 295

          #5
          Hello Maloz,
          Have you tried the method you indicated with remote network units ??, I'm testing it and it only discovers the connected local disks.
          The method I indicated above is the only one I found to check the remote network units, if your method would work for these units it would be much better and more elegant.

          Comment

          • maloz
            Junior Member
            • Feb 2018
            • 10

            #6
            Hello sancho,

            can you explain what you mean with "remote network units"?
            We have some iSCSI attached storage to our servers which get detected by FS LLD aswell. So in our case everything is looking fine.

            Comment

            • sancho
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Mar 2015
              • 295

              #7
              Hello Maloz,
              Sorry for my English, I mean mapped units.

              I do not know if you understand me

              Comment

              • maloz
                Junior Member
                • Feb 2018
                • 10

                #8
                Unfortunately no.

                What I think you might could mean are connected network shares in user context?
                Thats not a classical local disk and LLD won't discover this.

                Comment

                • sancho
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Mar 2015
                  • 295

                  #9
                  Yes,
                  That is, the method that I put is the only way I managed to monitor that type of resources.

                  Comment

                  Working...