Ad Widget

Collapse

Discovery rule with JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • josedo3010
    Junior Member
    • May 2022
    • 1

    #1

    Discovery rule with JSON

    Hi guys,

    Through a script I generate with the jq command a JSON which has the following values:

    {
    "paging": {
    "count": 20,
    "total": 8219,
    "offset": 0,
    "max": 20
    },
    "executions": [
    {
    "id": 75016,
    "status": "succeeded",
    "project": "Rundeck",
    "executionType": "scheduled",
    "user": "admin.local",
    "date-started": {
    "unixtime": 1653538200041,
    "date": "2022-05-26T04:10:00Z"
    },
    "date-ended": {
    "unixtime": 1653539949415,
    "date": "2022-05-26T04:39:09Z"
    },
    "job": {
    "id": "fa39346f",
    "averageDuration": 1771571,
    "name": "Test Start QA",
    "group": "TESTING-QA/ SCHEDULE/START",
    "project": "Barone",
    "description": ""
    },
    "description": "chmod +x /root/scripts/start/test.sh",
    "argstring": null,
    "serverUUID": "2ca3d0d181c4",
    "successfulNodes": [
    "test1.local",
    "test2.local",
    "test3.local",
    "test4.local",
    "test5.local"
    ]
    },
    {
    "id": 75014,
    "status": "succeeded",
    "project": "Rundeck",
    "executionType": "scheduled",
    "user": "admin.local",
    "date-started": {
    "unixtime": 1653537600062,
    "date": "2022-05-26T04:00:00Z"
    },
    "date-ended": {
    "unixtime": 1653538441508,
    "date": "2022-05-26T04:14:01Z"
    },
    "job": {
    "id": "51946dbc",
    "averageDuration": 864373,
    "name": "Test Start",
    "group": "TESTING-DEV/ SCHEDULE/START",
    "project": "Rundeck",
    "description": ""
    },
    "description": "chmod +x /root/scripts/start/test.sh",
    "argstring": null,
    "serverUUID": "6ac6764d",
    "successfulNodes": [
    "test1.local",
    "test2.local",
    "test3.local",
    "test4.local",
    "test5.local"
    ]
    }

    I am trying to generate a discovery rule so that it generates items using the "name" field and, whose value is the "status" field, but in any case zabbix shows me an error... What would be the correct sequence to generate all this, including LLD macros? Thanks in advance.

    thanks.
Working...