Ad Widget

Collapse

LLD Problem with tying to get the value.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sistemaspcp
    Junior Member
    • Jul 2017
    • 2

    #1

    LLD Problem with tying to get the value.

    I'm trying to do a discovery to get info from antivirus software.

    In zabbix_agentd.conf i put this:

    Code:
    UserParameter=custom.discovery, cscript c:\soft\zabbix\av.vbs //NOLOGO
    With this result:

    Code:
    {"data":[
    {"{#DISPLAYNAME}": "ESET Endpoint Security 6.4.2014.2",
    "{#PRODUCTSTATE}": "266240",
    "{#TIMESTAMP}": "Tue, 18 Jul 2017 21:24:26 GMT"},
    {"{#DISPLAYNAME}": "Windows Defender",
    "{#PRODUCTSTATE}": "393472",
    "{#TIMESTAMP}": "Thu, 10 Nov 2016 12:20:52 GMT"}
    ]}
    My Discovery rule is this:

    Code:
    Name: Antivirus
    Type: Zabbix Agent (Active)
    key: custom.discovery
    And i create this item prototype:

    Code:
    Name: Antivirus {#DISPLAYNAME}
    Type: Zabbix Agent (Active)
    Key: custom.discovery[ {#DISPLAYNAME}, PRODUCTSTATE]
    My problem is when the item trying to get the "Productstate", the items are discovered correctly, but without value.

    At the Configuration/Host/Item, i see the error "Item does not allow parameters" in each item created from the discovery.

    i need the item name are {#DISPLAYNAME} and his value {#PRODUCTSTATE}

    Somebody can help me? Thx!
  • Linwood
    Senior Member
    • Dec 2013
    • 398

    #2
    This is pretty old, not sure if you got it solved?

    LLD needs to return values to create real items from prototypes.

    The items then make yet another call to return the value (call to what depends).

    What you are doing is mixing the two - your script is returning an itemization of the AV programs, but it is also returning attributes of them.

    To be more specific, I would change your LLD script to return only a product name, and create items from it like

    ESET Endpoint Security Version
    ESET Endpoint Security State
    ESET Endpoint Security Update Timestamp

    Windows Defender Version
    Windows Defender State
    Windows Defender Update Timestamp

    No values yet. Then create a script that is Zabbix Trap or External (it can be the same script with just a different calling sequence), which is invoked for a specific service and returns a the specific data.

    I've done this very effectively with the same script using Zabbix Trapper data. Let the LLD return values to create items, and since it is creating the items it knows what item keys to use to send back trap data at the same time. The very first (or first few) times you try returning the trap data will fail as the items take a bit of time to show up, but then you get the LLD and population at the same time from the same script. BUT-- the data comes back through two different paths - the return in STDOUT from the script is LLD and just the names, and the return of the data goes back as a send to trapper.

    Comment

    • sistemaspcp
      Junior Member
      • Jul 2017
      • 2

      #3
      Thank you very much.


      you're right. i changed the script LLD and now works fine!.

      Comment

      Working...