Ad Widget

Collapse

File system auto discovery and mount --bind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matthias R
    Junior Member
    • Jul 2012
    • 19

    #1

    File system auto discovery and mount --bind

    We are using Zabbix (Version: 2.0.1) for about a while and it is monitoring three servers by now. The servers are all Linuxes. I used Template OS Linux, which includes file system auto discovery. It does it’s job too well:

    The servers provide file system access by WebDAV. WebDAV doesn’t allow symbolic links by specification, so we have to mount --bind each directory. This results in all mounts being monitored by Zabbix now. I want to get rid of the mount --bind mounted directories in Zabbix while keeping the ‘real’ mounted file systems.

    • I cannot delete the items manually because the check box to select them is greyed out. (That doesn’t solve the problem but it’s the first thought I had)

    • I tried to set the file system auto discovery for the Template OS Linux to „disabled“ in hope that they would all become deleted but it didn’t happen.

    What can I do? Any help is apreciated.
  • EnigmA-X
    Senior Member
    Zabbix Certified Specialist
    • Oct 2010
    • 116

    #2
    Just out of curiousity: what is the exact reason that you don't remove them, instead of disabling?

    Did you wait long enough for the configuration cache to kick in?

    Comment

    • Matthias R
      Junior Member
      • Jul 2012
      • 19

      #3
      First I wanted to see what happens. I hoped when I disable auto discovery everything it has discovered will either be deleted or at least be allowed to delete manually.

      Remove whom?
      • As I wrote: I cannot delete the items manually because the check box to select them is greyed out.
      • Did you mean: Delete “Mounted filesystem discovery” from “Discovery rules”
      • or delete “Template OS Linux” from the selected hosts?

      What would happen then?

      Yes, i did it yesterday but it didn’t modify anything until now.

      Comment

      • ArtemK
        Senior Member
        • May 2013
        • 232

        #4
        I think, you could use {#FSNAME} as filter macros in discovery options for linux template (clone template or discovery rule for testing) and adjust then regular expression to see only needed filesystems, filtering them by name

        it's probably not the best solution, but it should work. Or, as EnigmA-X said, you could just disable discovered 'bind' mountpoints

        Comment

        • EnigmA-X
          Senior Member
          Zabbix Certified Specialist
          • Oct 2010
          • 116

          #5
          Well, disabling the autodiscovery rule means that Zabbix cannot detect any changes, so I'm not surprised that the items didn't disappear. It's just a way of looking at it, I guess.

          They greyed out boxes are they in the template items, or in the host items view?

          Comment

          • Matthias R
            Junior Member
            • Jul 2012
            • 19

            #6
            The filter seems to be the right option. This is the output of the “mount” command:

            /dev/sda2 on / type ext3 (rw,acl,user_xattr)
            proc on /proc type proc (rw)
            sysfs on /sys type sysfs (rw)
            debugfs on /sys/kernel/debug type debugfs (rw)
            udev on /dev type tmpfs (rw,mode=0755)
            tmpfs on /dev/shm type tmpfs (rw,mode=1777)
            devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
            /data on /data type ext3 (rw,acl,user_xattr)
            fusectl on /sys/fs/fuse/connections type fusectl (rw)
            securityfs on /sys/kernel/security type securityfs (rw)
            none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
            rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
            none on /var/lib/ntp/proc type proc (ro,nosuid,nodev)
            /data/contents/35/ocr on /data/users/muller/MD_1049__[35]/ocr type none (rw,bind)
            /data/contents/35/images on /data/users/muller/MD_1049__[35]/images type none (rw,bind)
            /data/contents/37/ocr on /data/users/muller/MD_1190__[37]/ocr type none (rw,bind)
            /data/contents/37/images on /data/users/muller/MD_1190__[37]/images type none (rw,bind)
            /data/contents/38/ocr on /data/users/muller/MD_1632__[38]/ocr type none (rw,bind)
            /data/contents/38/images on /data/users/muller/MD_1632__[38]/images type none (rw,bind)
            /data/contents/39/ocr on /data/users/muller/MD_1820__[39]/ocr type none (rw,bind)
            /data/contents/39/images on /data/users/muller/MD_1820__[39]/images type none (rw,bind)
            /data/contents/40/ocr on /data/users/muller/MD_1845__[40]/ocr type none (rw,bind)
            /data/contents/40/images on /data/users/muller/MD_1845__[40]/images type none (rw,bind)
            /data/contents/41/ocr on /data/users/muller/MD_1882__[41]/ocr type none (rw,bind)
            /data/contents/41/images on /data/users/muller/MD_1882__[41]/images type none (rw,bind)
            /data/contents/42/ocr on /data/users/muller/MD_1975__[42]/ocr type none (rw,bind)
            /data/contents/42/images on /data/users/muller/MD_1975__[42]/images type none (rw,bind)
            /data/contents/43/ocr on /data/users/muller/MD_1986__[43]/ocr type none (rw,bind)
            /data/contents/43/images on /data/users/muller/MD_1986__[43]/images type none (rw,bind)
            /data/contents/21/ocr on /data/users/muller/MD_2028__[21]/ocr type none (rw,bind)
            /data/contents/21/images on /data/users/muller/MD_2028__[21]/images type none (rw,bind)
            /data/contents/14/ocr on /data/users/muller/MD_2029__[14]/ocr type none (rw,bind)
            /data/contents/14/images on /data/users/muller/MD_2029__[14]/images type none (rw,bind)
            /data/contents/15/ocr on /data/users/muller/MD_2030__[15]/ocr type none (rw,bind)
            /data/contents/15/images on /data/users/muller/MD_2030__[15]/images type none (rw,bind)
            /data/contents/22/ocr on /data/users/muller/MD_2031__[22]/ocr type none (rw,bind)
            /data/contents/22/images on /data/users/muller/MD_2031__[22]/images type none (rw,bind)
            /data/contents/23/ocr on /data/users/muller/MD_2032__[23]/ocr type none (rw,bind)
            /data/contents/23/images on /data/users/muller/MD_2032__[23]/images type none (rw,bind)
            /data/contents/20/ocr on /data/users/muller/MD_2033__[20]/ocr type none (rw,bind)
            /data/contents/20/images on /data/users/muller/MD_2033__[20]/images type none (rw,bind)
            /data/contents/44/ocr on /data/users/muller/MD_2271__[44]/ocr type none (rw,bind)
            /data/contents/44/images on /data/users/muller/MD_2271__[44]/images type none (rw,bind)
            /data/contents/45/ocr on /data/users/muller/MD_2273__[45]/ocr type none (rw,bind)
            /data/contents/45/images on /data/users/muller/MD_2273__[45]/images type none (rw,bind)
            /data/contents/48/ocr on /data/users/muller/MD_2393__[48]/ocr type none (rw,bind)
            /data/contents/48/images on /data/users/muller/MD_2393__[48]/images type none (rw,bind)
            /data/contents/60/ocr on /data/users/muller/MD_2417__[60]/ocr type none (rw,bind)
            /data/contents/60/images on /data/users/muller/MD_2417__[60]/images type none (rw,bind)
            /data/contents/61/ocr on /data/users/muller/MD_2586__[61]/ocr type none (rw,bind)
            /data/contents/61/images on /data/users/muller/MD_2586__[61]/images type none (rw,bind)
            /data/contents/62/ocr on /data/users/muller/MD_2707__[62]/ocr type none (rw,bind)
            /data/contents/62/images on /data/users/muller/MD_2707__[62]/images type none (rw,bind)
            /data/contents/63/ocr on /data/users/muller/MD_2739__[63]/ocr type none (rw,bind)
            /data/contents/63/images on /data/users/muller/MD_2739__[63]/images type none (rw,bind)
            /data/contents/66/ocr on /data/users/muller/MD_2984__[66]/ocr type none (rw,bind)
            /data/contents/66/images on /data/users/muller/MD_2984__[66]/images type none (rw,bind)
            /data/contents/68/ocr on /data/users/muller/MD_3289__[68]/ocr type none (rw,bind)
            /data/contents/68/images on /data/users/muller/MD_3289__[68]/images type none (rw,bind)
            /data/contents/70/ocr on /data/users/muller/MD_4003__[70]/ocr type none (rw,bind)
            /data/contents/70/images on /data/users/muller/MD_4003__[70]/images type none (rw,bind)
            /data/contents/71/ocr on /data/users/muller/MD_4057__[71]/ocr type none (rw,bind)
            /data/contents/71/images on /data/users/muller/MD_4057__[71]/images type none (rw,bind)
            /data/contents/57/ocr on /data/users/muller/MD_5537__[57]/ocr type none (rw,bind)
            /data/contents/57/images on /data/users/muller/MD_5537__[57]/images type none (rw,bind)
            /data/contents/50/ocr on /data/users/muller/MD_5540__[50]/ocr type none (rw,bind)
            /data/contents/50/images on /data/users/muller/MD_5540__[50]/images type none (rw,bind)
            /data/contents/30/ocr on /data/users/muller/MD_561__[30]/ocr type none (rw,bind)
            /data/contents/30/images on /data/users/muller/MD_561__[30]/images type none (rw,bind)
            /data/contents/51/ocr on /data/users/muller/MD_5653__[51]/ocr type none (rw,bind)
            /data/contents/51/images on /data/users/muller/MD_5653__[51]/images type none (rw,bind)
            /data/contents/52/ocr on /data/users/muller/MD_5674__[52]/ocr type none (rw,bind)
            /data/contents/52/images on /data/users/muller/MD_5674__[52]/images type none (rw,bind)
            /data/contents/29/ocr on /data/users/muller/MD_63__[29]/ocr type none (rw,bind)
            /data/contents/29/images on /data/users/muller/MD_63__[29]/images type none (rw,bind)
            /data/contents/56/ocr on /data/users/muller/MD_6894__[56]/ocr type none (rw,bind)
            /data/contents/56/images on /data/users/muller/MD_6894__[56]/images type none (rw,bind)
            /data/contents/32/ocr on /data/users/muller/MD_754__[32]/ocr type none (rw,bind)
            /data/contents/32/images on /data/users/muller/MD_754__[32]/images type none (rw,bind)
            /data/contents/33/ocr on /data/users/muller/MD_821__[33]/ocr type none (rw,bind)
            /data/contents/33/images on /data/users/muller/MD_821__[33]/images type none (rw,bind)
            /data/contents/34/ocr on /data/users/muller/MD_982__[34]/ocr type none (rw,bind)
            /data/contents/34/images on /data/users/muller/MD_982__[34]/images type none (rw,bind)

            You see all the additional mounts I would like to exclude. What do I have to put in which field? What are my options? I read {#FSTYPE} and {#FSNAME} but what do they contain?

            Cloning a template doesn’t work correctly: Half of the stuff gets lost, including the whole auto discovery section.

            Comment

            • ArtemK
              Senior Member
              • May 2013
              • 232

              #7
              use full clone, Luke!

              well, looks like #FSNAME filtering will not help you, it's too complicated. You should really ask for a script from this thread, where the same problem were discussed

              Comment

              • Matthias R
                Junior Member
                • Jul 2012
                • 19

                #8
                I used export template and import template, I didn’t know they allow Clone.

                Well so I made a copy of the template and removed autodiscovery file systems from it. I removed the old template from the hosts in question and added the new one instead. I did this friday, but the hundreds of triggers and items still don’t disappear and cannot be deleted either. What do I miss?

                Filtering by regex on {#FSNAME} is really impossible because, i.e., there are two entries for "/":
                {
                "data":[
                {
                "{#FSNAME}":"\/",
                "{#FSTYPE}":"rootfs"},
                {
                "{#FSNAME}":"\/",
                "{#FSTYPE}":"ext3"},
                {
                So I either do not get / or I get it twice. And if I could get only one I couldn’t decide which one it would pick, “rootfs” or “ext3”. There would be need of two regexes being allowed.

                Comment

                • ArtemK
                  Senior Member
                  • May 2013
                  • 232

                  #9
                  Originally posted by Matthias R
                  What do I miss?
                  If you want to immediately remove all items and triggers, created by discovery, you should use "unlink and clear" in host template configuration, AFAIK, it will remove all data (discovery item's too) from that host only for that template (you should link original template back to host and then unlink then, if it's already unlinked)

                  Originally posted by Matthias R
                  Filtering by regex on {#FSNAME} is really impossible because, i.e., there are two entries for "/"
                  yep, that the problem, ask for a script from mentioned thread, it will discover only "real" filesystems.

                  Comment

                  • Matthias R
                    Junior Member
                    • Jul 2012
                    • 19

                    #10
                    Unlink and clear helped.

                    Many thanks for you advices.

                    I don’t want to over-complicate here. The solution is now what I prefer it to be, just without file system discovery. My hosts usually have two partitions with 6 triggers each that I want to watch. I can do that manually, which is also better because severity levels don’t propagate from the prototypes by bug, either. Installing and configuring a script solution on each host will not be so much easier.

                    Comment

                    • ArtemK
                      Senior Member
                      • May 2013
                      • 232

                      #11
                      Ok

                      also, if I understand correctly, you will be able to solve your problem with LLD, when this feature will be implemented in future version

                      Comment

                      • Matthias R
                        Junior Member
                        • Jul 2012
                        • 19

                        #12
                        This says it is “fixed”.

                        There is also need to parameterize it in the innput screen. Currently, there are two boxes, one for the field and one for the regular expression.

                        Comment

                        • ArtemK
                          Senior Member
                          • May 2013
                          • 232

                          #13
                          looks like it is fixed in current, maybe will be available in next update...

                          Comment

                          Working...