Ad Widget

Collapse

Zabbix ZFS discovery monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pbergdolt
    Junior Member
    • May 2009
    • 10

    #1

    Zabbix ZFS discovery monitoring

    Hello All,

    I have developped discovery rules for zfs storage monitoring, and I'd like to share this with you.
    This has been validated on Centos but may be easily adapted for Oracle servers (where the zfs is native).

    Below are the steps needed to install the zfs discovery rules:

    1) add the userparameter_zfs.conf file into /usr/local/etc/zabbix_agentd.conf.d directory on the host you want to monitor zfs

    2) allow the zabbix user to run "zpool" and "zfs" commands
    this is done by copying the "zabbix_sudo" file under /etc/sudoers.d directory

    3) import the zbx_export_template.xml into zabbix

    4) in zabbix gui add the "Template App ZFS" to the host you want to monitor zfs
    this will create a refer and used item for each zfs fileset
    also a zpool healt item, zpool available item. Graph will be also created


    Feel free to comment and improve.
    Regards
    Attached Files
    Last edited by pbergdolt; 27-11-2013, 16:57.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Originally posted by pbergdolt
    This has been validetd on Centos but may be easily adapted for Oracle servers (where the zfs is native).
    CentOS has native ZFS support?
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • pbergdolt
      Junior Member
      • May 2009
      • 10

      #3
      No there is no native support for ZFS on any of linux distro. You'll have to download and build. This has been done easily on Centos 6.3 and 6.4
      Regards

      Comment

      • JSylvia007
        Junior Member
        • Sep 2007
        • 29

        #4
        pbergdolt,

        Sorry to bring up such an old thread, I've successfully implemented your scripts from this post, and it's been a lifesaver on linux. I'm having an issue with FreeBSD (FreeNAS specifically) where it doesn't like the sed commands... Something about a new-line charecter...

        I was wondering if you'd be willing to help me out?

        Comment

        • Slash
          Member
          • May 2011
          • 64

          #5
          Thank you for this template, it works perfectly

          Comment

          • V.Reddy
            Junior Member
            • Oct 2014
            • 10

            #6
            zabbix zfs monitoring

            Hi,

            I have imported zfs template into my zabbix server 2.4.0 and i did the step you mentioned. I tried to monitor my zfs pool on ubuntu server. but in zfs template discovery item value showing unsupported item key.
            any help greatly appreciated.

            Thanks

            Comment

            • V.Reddy
              Junior Member
              • Oct 2014
              • 10

              #7
              zabbix zfs monitoring

              Please any help on this?
              Last edited by V.Reddy; 26-11-2014, 07:57.

              Comment

              • pdwalker
                Senior Member
                • Dec 2005
                • 166

                #8
                It's hard to help you when you have provided no information.

                Did you ever solve your problem eventually?

                Comment

                • dirtydriver
                  Junior Member
                  • Feb 2013
                  • 26

                  #9
                  Zfs script problem

                  Hy All !

                  I tried the zfs monitoring but when i run the scripts i always get
                  Unrecognized command: $ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/]

                  Does Anybody meets this problem ?

                  Comment

                  • Slash
                    Member
                    • May 2011
                    • 64

                    #10
                    I added this template on https://share.zabbix.com/cat-app/cat...s/zfs-on-linux with some modification.

                    Comment

                    • iav
                      Junior Member
                      • Apr 2014
                      • 10

                      #11
                      Originally posted by dirtydriver
                      I tried the zfs monitoring but when i run the scripts i always get
                      Unrecognized command: $ ! s/\(.*\)/{"{#FILESETNAME}":"\1"},/]
                      See the same on sparc solaris.
                      Fixed by usage gnu sed - on solaris 11 it lays in /usr/gnu/bin/sed

                      Comment

                      • iav
                        Junior Member
                        • Apr 2014
                        • 10

                        #12
                        Originally posted by Slash
                        I added this template on https://share.zabbix.com/cat-app/cat...s/zfs-on-linux with some modification.
                        Seems you don't.
                        Why?

                        Comment

                        • Slash
                          Member
                          • May 2011
                          • 64

                          #13
                          Originally posted by iav
                          Seems you don't.
                          Why?
                          I did... but share.zabbix.com is still a beta, my account on it is gone too :/

                          I will add the 2 versions I have, one is for ZFS on Linux and the other is for FreeBSD (this one may work for Solaris or other unixes).

                          Comment

                          • Slash
                            Member
                            • May 2011
                            • 64

                            #14
                            I have re-added the ZFS templates on share.zabbix.com.

                            For ZFS on Linux: https://share.zabbix.com/operating-s...x/zfs-on-linux
                            For ZFS on FreeBSD (may work on other unixes): https://share.zabbix.com/operating-systems/freebsd/zfs

                            Comment

                            • iav
                              Junior Member
                              • Apr 2014
                              • 10

                              #15
                              Thank you, Slash!
                              Now trying to adapt your bsd for solaris.

                              Solaris 11 contains GNU sed; Solaris 10 not.
                              For Solaris 10 can be used rules:

                              Code:
                              UserParameter=zfs.pool.discovery,/sbin/zpool list -H -o name | awk 'BEGIN{print"{\"data\":[";}NR > 1 { printf(", ") }{print"{\"{#POOLNAME}\":\""$1"\"}";}END{print "]}";}'
                              UserParameter=zfs.fileset.discovery,/sbin/zfs list -H -o name -t vol,fs | awk 'BEGIN{print"{\"data\":[";}NR > 1 { printf(", ") }{print"{\"{#FILESETNAME}\":\""$1"\"}";}END{print "]}";}'
                              "-t vol,fs" added to skip snapshots in case of listsnapshots=on for pools

                              Comment

                              Working...