Ad Widget

Collapse

Trigger when Filesystem is not discovered anymore

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amiram
    Member
    • Feb 2021
    • 59

    #1

    Trigger when Filesystem is not discovered anymore

    Hey,

    I'm very new at Zabbix and I wondered if there is any way to trigger an alert when a File-System is no longer discovered by the Mount LLD rule.

    I have mounted FS on my Linux server at `/data` and I want to get an alert once it is unmounted.

    How can I achieve this?
    And can I filter out "not interesting" FS?

    Amiram
  • gofree
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2017
    • 400

    #2
    Hi

    to check if FS is still mounted - check some particular file/folder presence in it - example: vfs.file.exists[file,<types_incl>,<types_excl>]. I don't remeber a way to trigger an alert on "not anymore discovered FS", but I did the easy way ( check for file/folder existence - also custom user parameter can applied for more complicated check)
    https://www.zabbix.com/documentation...s/zabbix_agent

    for filtering check FILTER section in docu

    Comment

    • Amiram
      Member
      • Feb 2021
      • 59

      #3
      Thank you gofree

      I suppose that will work the same for "normal" mount point like cifs/fuse etc...
      There is no "pretty" way of doing it?
      like:
      vfs.mount.is_mounted for example:

      I noticed that I can create UserParameter for custom scripts.
      Correct me if I'm wrong here, that UserParameter just "export/expose" data from the local host and the server is responsible to gather it and create triggers according to that data.
      Now,
      I can create UserParamater as follow:
      Code:
      UserParameter=vfs.mount.is_mounted,mountpoint -q $1
      And at the server side create a items with a key (for example) vfs.mount.is_mounted[/mnt/example] and maybe create a trigger as well.

      This will do the work?

      Amiram

      Comment

      • gofree
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2017
        • 400

        #4
        Hi

        Useraparameters are just another way how to collect data , all the other steps needs to be done in zabbix gui ( items, triggers, etc )


        Your userparamter will not work ( 2 reasons ) - see the docu
        missed[*]
        -q parameter is silent - will not print anything


        this might work
        Code:
        UserParameter=vfs.mount.is_mounted[*],mountpoint  $1

        example ( you can check for string "is not a mountpoint" or play further with preprocessing to get smaller data footprint ):

        Code:
        [root@host gofree]# umount /mnt/usb_ext_backup
        [root@host gofree]# mountpoint /mnt/usb_ext_backup
        /mnt/usb_ext_backup is not a mountpoint
        [root@host gofree]# mount /mnt/usb_ext_backup
        [root@host gofree]# mountpoint /mnt/usb_ext_backup
        /mnt/usb_ext_backup is a mountpoint
        [root@host gofree]# mountpoint -q /mnt/usb_ext_backup
        last line goes silent with -q


        Comment

        Working...