Ad Widget

Collapse

Custom Discovery Rule Not Working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itsalexjones
    Junior Member
    • Dec 2020
    • 4

    #1

    Custom Discovery Rule Not Working

    Hi Folks,

    I'm relatively new to Zabbix and am attempting to write an agent to send statistics from an in house app to Zabbix via trapper items.
    I've successfully managed to get a number of stats into Zabbix this way, but I'm struggling with info that requires the use of a discovery item.

    Each instance of the app to monitor contains a number of streams that I'd like to discover and then monitor. The update (or a snippet of the update) that gets sent to the server (including Zabbix header etc) is below (pasted with indentation and new lines for convenience).

    Code:
    {
      "request": "sender data",
      "data": [
        {
          "host": "LQAJDEV",
          "key": "blast.discovery",
          "value": [
            {
              "type": 0,
              "subType": 0,
              "objectID": 26759152,
              "subObjectID": 0,
              "label": "C7",
              "description": "<redacted>",
              "state": 10,
              "icon": 1
            },
            {
              "type": 0,
              "subType": 0,
              "objectID": 26947248,
              "subObjectID": 0,
              "label": "C1",
              "description": "<redacted>",
              "state": 10,
              "icon": 1
            },
            {
              "type": 0,
              "subType": 1,
              "objectID": 26947248,
              "subObjectID": 42039200,
              "label": "P1",
              "description": "",
              "state": 10,
              "icon": 1
            },
            {
              "type": 0,
              "subType": 1,
              "objectID": 26759152,
              "subObjectID": 42163088,
              "label": "P7",
              "description": "",
              "state": 10,
              "icon": 1
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27069264,
              "label": "S1AH",
              "description": "<redacted>, primary, 384k",
              "state": 10,
              "icon": 1
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27069840,
              "label": "S1BH",
              "description": "<redacted>, backup, 384k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27065808,
              "label": "S7AH",
              "description": "<redacted>, primary, 384k",
              "state": 10,
              "icon": 1
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27070416,
              "label": "S1AL",
              "description": "<redacted>, primary, 192k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27066384,
              "label": "S7BH",
              "description": "<redacted>, backup, 384k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27070992,
              "label": "S1BL",
              "description": "<redacted>, backup, 192k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27066960,
              "label": "S7AL",
              "description": "<redacted>, primary, 192k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27067536,
              "label": "S7BL",
              "description": "<redacted>, backup, 192k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27068112,
              "label": "S7UBH",
              "description": "<redacted>, unicast backup, 384k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27096592,
              "subObjectID": 27068688,
              "label": "S7UAL",
              "description": "<redacted>, unicast primary, 192k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27071568,
              "label": "S1UBH",
              "description": "<redacted>, unicast backup, 384k",
              "state": 30,
              "icon": 5
            },
            {
              "type": 1,
              "subType": 2,
              "objectID": 27095968,
              "subObjectID": 27072144,
              "label": "S1UAL",
              "description": "<redacted>, unicast primary, 192k",
              "state": 30,
              "icon": 5
            }
          ]
        }
      ]
    }
    Right now all I have is a discovery item for this with an LLD macro {#LABEL} configured to get $.label and an item prototype for "Stream {#LABEL} State" which has an pre-processing step to fetch the $.state value for the item.

    For some reason i never get any items in my host. There are no errors showing next to the Discovery Rule or Item.

    We're running Zabbix 5.2 on Ubuntu 20.04.1 and the JSON validates on JSONLint.

    Does anyone have any suggestions why i'm never seeing any items, I've been tearing my hair out on this for at least a week now!

    Thanks,
Working...