Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16821

Issue with very specific LLD item

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 4.2.7
    • Server (S)
    • None
    • Linux

      I'm trying to implement swap monitoring using LLD to have dynamic swap space monitoring depends on is swap is used on exact system or not.

      I'm trying to relay in fact that if swap is not used /proc/meminfo has line "SwapTotal: 0 kB" and if is used that line contains non-zero size of the swap.

      So my LLD item has:

      Name: "SWAP:"

      Type: "zabbix agent (active)"

      Key: vfs.file.contents[/proc/meminfo]

      To that item I'm adding Preprocessing with Preprocessing steps:

      1. Regular expression:
        Parameters: SwapTotal: ([0-9])
        Output: [\{"\{#SWAP}":\1}]

      Using test item I've checked that it produces output like

       

      [{"{#SWAP}":10485756}] 
      

      So it can be used as iterator of the LLD.

       

      Additionally I have filter which is removing from that LLD item values {#SWAP}=0.

      I've tested that it produces "[]" or `[\{"\{#SWAP}":10485756}]'.

      So far nothing is wrong but on adding prototype item to that LLD like:

      Name: total
      Key: that LLD on exact hosts is marked with error:

      "Cannot create item: item with the same key "system.swap.size[,total]" already exists."

      Which is a bit strange because LLD loop will be able to do zero or only one iteration so that LLD should not be able create multiple items with exactly the same key.

      I have no other item used on that host which is using system.swap.size[,total] key.

      I've checked the 4.2 code and I found that probably for that error is responsible https://github.com/zabbix/zabbix/blob/release/4.2/src/zabbix_server/lld/lld_item.c#L1614 but I do not understand why.

      I've tested that that error message is reported when LLD item is first time created (not on update).

            Unassigned Unassigned
            kloczek Tomasz Kłoczko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: