Ad Widget

Collapse

Grab SNMP traps via API... or another method?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skullbox15
    Junior Member
    • Aug 2023
    • 5

    #1

    Grab SNMP traps via API... or another method?

    I'm new to zabbix... tried searching but couldn't find anything related to what I'm trying to do:

    I have some SNMP traps going into zabbix. Is it possible to use the API to grab trap events? I'm trying to get the info in a json format if possible so I can feed it into a nifi server.

    If not via the API... what would be the best way?
  • skullbox15
    Junior Member
    • Aug 2023
    • 5

    #2
    I solved my own problem... Here is the API details I used:

    curl -X POST -H "Content-Type: application/json" -d '{
    "jsonrpc": "2.0",
    "method": "item.get",
    "params": {
    "output": "extend",
    "hostids": "10588", <-- replace with your host ID
    "search": {
    "key_": "snmptrap.fallback"
    }
    },
    "auth": "YOUR-AUTH-KEY",
    "id": 2
    }' "http://YOUR-URL/api_jsonrpc.php"

    Comment

    Working...