Ad Widget

Collapse

Linux Filesystem Stats Discovery Rule - w/DM support

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jburkemx
    Junior Member
    • Apr 2013
    • 10

    #1

    Linux Filesystem Stats Discovery Rule - w/DM support

    I modified ghillan device_mapper script from https://www.zabbix.com/forum/showpos...77&postcount=7 to handle normal /dev's and also device mappers.

    The primary change was to add a check to see if the filesystem name (returned from /proc/mounts) has "mapper" in it, if so it does another step is done to find the /dev/dm-? for each /dev/mapper device.


    When called without arguments, device_mapper.pl returns three values for each mount:
    FSNAAME = the mount point
    FSDEVICE = the /dev/ device (sda or dm-)
    FSTYPE = the filesystem type.

    for example, the root filesystem:
    "{#FSNAME}":"\/",
    "{#FSDEVICE}":"dm-7",
    "{#FSTYPE}":"ext4" },


    User Parameter for your zabbix_config:
    UserParameter=device_mapper[*],/usr/bin/device_mapper.pl $1 $2

    Discovery Template is attached.


    ToDo: Add step to get device for UUID mounted drives (/dev/disk/by-uuid/xxxxx-xxxx-xxx)
    Attached Files
  • Datacenter1.com
    Junior Member
    • May 2006
    • 10

    #2
    Works great ! Thanks for sharing

    Comment

    • Jburkemx
      Junior Member
      • Apr 2013
      • 10

      #3
      Btw, double check the template items and graphs. I think I made some minor configuration errors in them. Specifically in regards to the Read/Write times and IO times.

      Comment

      • pietro54
        Senior Member
        • Feb 2011
        • 112

        #4
        same here

        Comment

        • Datacenter1.com
          Junior Member
          • May 2006
          • 10

          #5
          Originally posted by Jburkemx
          Btw, double check the template items and graphs. I think I made some minor configuration errors in them. Specifically in regards to the Read/Write times and IO times.
          I see, I set units to ms and looks like I'm getting the right values, is that enough?

          Comment

          • Jburkemx
            Junior Member
            • Apr 2013
            • 10

            #6
            Originally posted by Datacenter1.com
            I see, I set units to ms and looks like I'm getting the right values, is that enough?
            Yes, i think that was it.

            Comment

            • lmf-mx
              Junior Member
              • Sep 2018
              • 2

              #7
              Fixed the trailing comma on the last object and removed the empty object. No more "no value received for macro".
              Attached Files

              Comment

              Working...