Ad Widget

Collapse

How to setup low level discovery of local disk only

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdresden
    Junior Member
    • Jan 2014
    • 16

    #1

    How to setup low level discovery of local disk only

    Zabbix 2.2 comes with a default set of low level mounted file system discovery in the linux OS template and the linux SNMP Disk template.

    While theses are cool, they are not practical for my environment. I have hundreds of servers that all use the same nfs mounts. If one is running low on disk space I get alerts on hundreds of servers.

    I would like to discover specifically only local mounted storage for the zabbix agent template and the snmp template.
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    Correct Administration -> General -> Regular Expression -> File systems for discovery to discover only local filesystem (remove nfs from list)
    Sincerely yours,
    Aleksey

    Comment

    • mdresden
      Junior Member
      • Jan 2014
      • 16

      #3
      Thanks for sharing this, but nfs isnt in the current default list

      Code:
      ^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|ntfs|fat32|zfs)$
      Do I need to add some kind of exclude rule here?

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        I cannot understand why you have NFS disks discovered if your Regular Expression doesn't allow you to discover it.

        Did you add it manually?
        Sincerely yours,
        Aleksey

        Comment

        • mdresden
          Junior Member
          • Jan 2014
          • 16

          #5
          This check is default as shipped with zabbix 2.2

          I don't understand this either now. The regex would not match on nfs. If I run a mount command, the nfs mounts do contain "nfs" in that mounted fs data. I would be helpful to see the output that the regex is being matched against.

          The regex from my understanding is looking for a line that only contains the fs type, like '^ext3$'. In reading the manual it seems implied that it would be getting output in json format, but even then the lines would contain more than ext3.

          Is there a way to get a deeper look at what is actually going on, so I could write a better filter, if the problem does indeed lie there?

          Something else I am wondering is the relationship to the macro setting next to the regex filter. Is this macro set to the value of the matched output from the regex, or define somewhere else?

          When the check populate the templates the macro becomes the mount point, but the mount points is not the fs type.

          Also in some situations I have 6 separate unique nfs volumes like:

          Code:
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore1 on /common/data/blah/per_core1 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore2 on /common/data/blah/per_core2 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore3 on /common/data/blah/per_core3 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore4 on /common/data/blah/per_core4 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore5 on /common/data/blah/per_core5 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          blah.storage.us.blah.net:/ifs/BlahBlah/Blah/BlahPeriodicalCore6 on /common/data/blah/per_core6 type nfs (rw,noatime,nfsvers=3,proto=tcp,soft,rsize=16384,wsize=32768,addr=10.10.10.10)
          But the default discovery process will just show a: /common volume, when there isn't a unique common volume.

          For now, I don't need to solve that, as I would rather not even discover them in the first place.

          Comment

          • aib
            Senior Member
            • Jan 2014
            • 1615

            #6
            Typically I use template "Template OS Linux" to monitor any Linux-based servers.
            That template has a discovery rule "Mounted filesystem discovery" to create Items/Triggers/Graphs for any mounted filesystem.
            And in that discovery rule the macro {#FSTYPE} use Regexp @File systems for discovery to select only that filesystem which described in macro.

            To check which kind of filesystem you have on your client's server just use command
            Code:
            # zabbix_get -s  {IP_of_CLIENT} -k vfs.fs.discovery
            and check JSON output.
            May be your filesystem has a type which is not masking by Regexp?
            Sincerely yours,
            Aleksey

            Comment

            • mdresden
              Junior Member
              • Jan 2014
              • 16

              #7
              That would be extremely useful. Where did you get that binary.

              Here is what I have:

              Code:
              $ ssh zabbix.blah.web
              
              [email protected]:/root
              # zabbix_
              zabbix_agent         zabbix_agentd        zabbix_server        zabbix_server_mysql
              
              [email protected]:/root
              # yum provides zabbix_get
              Loaded plugins: fastestmirror
              Loading mirror speeds from cached hostfile
               * base: mirror.ubiquityservers.com
               * epel: mirror.steadfast.net
               * extras: mirror.steadfast.net
               * updates: mirror.beyondhosting.net
              zabbix                                                                                                                                                        |  951 B     00:00
              zabbix-non-supported                                                                                                                                          |  951 B     00:00
              Warning: 3.0.x versions of yum would erroneously match against filenames.
               You can use "*/zabbix_get" and/or "*bin/zabbix_get" to get that behaviour
              No Matches found
              
              [email protected]:/root
              
              [email protected]:/root
              # locate zabbix_get
              
              [email protected]:/root
              Last edited by mdresden; 27-03-2014, 22:08.

              Comment

              • mdresden
                Junior Member
                • Jan 2014
                • 16

                #8
                Ahh, I typoes the query:

                Code:
                [email protected]:/root
                # yum provides */zabbix_get
                Loaded plugins: fastestmirror
                Loading mirror speeds from cached hostfile
                 * base: mirror.ubiquityservers.com
                 * epel: mirror.steadfast.net
                 * extras: mirror.steadfast.net
                 * updates: mirror.beyondhosting.net
                base/filelists_db                                                                                                                                             | 5.9 MB     00:02
                epel/filelists_db                                                                                                                                             | 8.4 MB     00:02
                extras/filelists_db                                                                                                                                           |  11 kB     00:00
                labs_consol_stable/filelists                                                                                                                                  | 206 kB     00:00
                updates/filelists_db                                                                                                                                          | 1.6 MB     00:00
                zabbix/filelists                                                                                                                                              |  19 kB     00:00
                zabbix-non-supported/filelists                                                                                                                                | 2.7 kB     00:00
                zabbix20-2.0.11-1.el6.x86_64 : Open-source monitoring solution for your IT infrastructure
                Repo        : epel
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix-proxy-1.8.20-1.el6.x86_64 : Zabbix Proxy
                Repo        : epel
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix22-2.2.1-5.el6.x86_64 : Open-source monitoring solution for your IT infrastructure
                Repo        : epel
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix-server-1.8.20-1.el6.x86_64 : Zabbix server common files
                Repo        : epel
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix-get-2.2.1-1.el6.x86_64 : Zabbix Get
                Repo        : zabbix
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix-get-2.2.2-1.el6.x86_64 : Zabbix Get
                Repo        : zabbix
                Matched from:
                Filename    : /usr/bin/zabbix_get
                
                
                
                zabbix-get-2.2.0-1.el6.x86_64 : Zabbix Get
                Repo        : zabbix
                Matched from:
                Filename    : /usr/bin/zabbix_get

                Comment

                • mdresden
                  Junior Member
                  • Jan 2014
                  • 16

                  #9
                  Ok, here is an example of the json output, which is awesome that I can see that btw !!!

                  Code:
                  		{
                  			"{#FSNAME}":"\/common\/data\/ocean\/per_core6",
                  			"{#FSTYPE}":"nfs"},
                  So, nfs is there and nfs is not one of the or options in the default expression???

                  It appears it aside from not cutting the nfs, it is grabbing the FSNAME wrong also, as I just see one /common fsname when infact there is not just /common, but several deeper paths where nfs is mounted that just share this parent directory

                  Comment

                  • aib
                    Senior Member
                    • Jan 2014
                    • 1615

                    #10
                    I installed it when I installed zabbix-server, I think.
                    Code:
                    # yum info zabbix-get
                    Loaded plugins: fastestmirror, security
                    Loading mirror speeds from cached hostfile
                     * base: less.cogeco.net
                     * epel: less.cogeco.net
                     * extras: centos.mirrors.atwab.net
                     * updates: less.cogeco.net
                    Installed Packages
                    Name        : zabbix-get
                    Arch        : i386
                    Version     : 2.2.2
                    Release     : 1.el6
                    Size        : 85 k
                    Repo        : installed
                    From repo   : zabbix
                    Summary     : Zabbix Get
                    URL         : http://www.zabbix.com/
                    License     : GPLv2+
                    Zabbix Download Page -> Zabbix 2.2.x packages -> Red Hat Enterprise Linux / CentOS / Oracle Linux -> Download Documentation

                    In your case just try to use command
                    Code:
                    # yum install zabbix-get
                    If it doesn't help - check the documentation.
                    Sincerely yours,
                    Aleksey

                    Comment

                    Working...