Ad Widget

Collapse

A way of ignoring triggers for selected drives using LLD?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jason
    Senior Member
    • Nov 2007
    • 430

    #1

    A way of ignoring triggers for selected drives using LLD?

    Using LLD we've an issue where USB drives keep getting picked up and we'd like a way of ignoring triggers for certain drives.
    I was thinking of creating a trigger called {$IGNORE_DRIVES} containing say "X:Y:" and then modifying the trigger to only fire if it can't find #FSNAME in this macro. Can this easily be done? I'm sure it can be somehow..
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    What OS are your monitored systems and what LLD you are using (zabbix agent filesystem discovery or SNMP based discovery)?

    It all depends on your discovery rules. Regarding zabbix agent's LLD you have macros {#FSTYPE} and {#FSNAME}.

    I would suggest to implement a custom discovery rule and add one more macro {#FSMOUNTPOINT} or even {#FSDEVICETYPE}.

    Then you could assign a filtering rule with regular expressions in which you exclude the undesired USB devices by excluding the mountpoints or device types.

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      If "X:" and "Y:" do mean windows drive letters then simply use the macro {#FSTYPE} and exclude returned results with value 'UNKNOWN'


      Code:
      zabbix_get -s mywindows2003server -k vfs.fs.discovery
      
      {
              "data":[
                      {
                              "{#FSNAME}":"A:",
                              "{#FSTYPE}":"UNKNOWN"},
                      {
                              "{#FSNAME}":"C:",
                              "{#FSTYPE}":"NTFS"},
                      {
                              "{#FSNAME}":"D:",
                              "{#FSTYPE}":"NTFS"},
                      {
                              "{#FSNAME}":"Y:",
                              "{#FSTYPE}":"UNKNOWN"},
                      {
                              "{#FSNAME}":"Z:",
                              "{#FSTYPE}":"UNKNOWN"}]}
      This is a VM with 2003R2 and two harddisks C: and D: and two virtual CD-Roms Y: and Z:

      So I defined a regular expression which excludes "UNKNOWN" for macro {#FSTYPE} to effectively prevent discovery of these drives. With no discovery you will not have items created und when there's no items you don't need any triggers.

      Comment

      • Jason
        Senior Member
        • Nov 2007
        • 430

        #4
        It is windows drives that i want to exclude. The problem is i only want to do it on some servers. The drives i want to exclude are usb drives and they will be an ntfs file system.

        Ideally i want all drives to be included in the discovery unless a macro or something else is defined that tells zabbis to ignore that drive letter.

        Comment

        • Jason
          Senior Member
          • Nov 2007
          • 430

          #5
          I'd not examined the filter on the discovery definition... Can the regexp bit be a macro? Then I could use that to exclude drive letters although not sure what would happen if the macro didn't exist for that host.

          Comment

          • steveboyson
            Senior Member
            • Jul 2013
            • 582

            #6
            The anchor for the regexp needs to be a value returned by your discovery rule.
            That's why I suggested to write your own LLD rule.

            So, include {#SYSTEMNAME} in your custom-written discovery rule returning the name of the queried server. Then create a regexp to filter out these servers you don't want to be discovered by excluding their names.

            P.S.:
            What gives "zabbix_get -s <your_server> -k vfs.fs.discovery" as the {#FSTYPE} value on affected machines with connected USB drives?

            Comment

            Working...