my goal is to create a list of port Items that i can then fill with the information "portname" and "alias description" and so one
I try to get a Switch Port List (Names and Alias) from a Discovery Rule type HTTP_AGENT. I get the Information from our InfluxDB.
From my HTTP Request i get a CSV and after Preprossing (1) CSV To JSON and (2) JSONPATH $.[4:-1] i have These json formatet String:
[
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Fa0","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/25","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/26","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/27","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/12","7":"*** Access LAN ***"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/13","7":"*** Access LAN ***"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/14","7":"*** Access LAN ***"},
...
{,{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi2/0/17","7":"AP"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi2/0/18","7":"AP"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/21","7":""FW Node 1","8":" Port 0","9":" Internet","10":" Backup""},
...
,{}
]
My LLD Macros ({#PORT}=$.[*]["6"]
ITEM Prototype has a Type Trapper
Name: portname"{#PORT}"
Type: Zabbix trapper
Key: port[{#PORT}]
Type of information:Text
If i execute the Discovery Role i get
"Cannot create item: item with the same key "port[{#PORT}]" already exists.
Cannot create item: item with the same key "port[{#PORT}]" already exists."
...





I try to get a Switch Port List (Names and Alias) from a Discovery Rule type HTTP_AGENT. I get the Information from our InfluxDB.
From my HTTP Request i get a CSV and after Preprossing (1) CSV To JSON and (2) JSONPATH $.[4:-1] i have These json formatet String:
[
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Fa0","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/25","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/26","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/27","7":""},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/12","7":"*** Access LAN ***"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/13","7":"*** Access LAN ***"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/14","7":"*** Access LAN ***"},
...
{,{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi2/0/17","7":"AP"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi2/0/18","7":"AP"},
{"1":"","2":"","3":"0","4":"2022-05-04T10:09:00.861155712Z","5":"2022-05-04T10:19:00.861155712Z","6":"Gi1/0/21","7":""FW Node 1","8":" Port 0","9":" Internet","10":" Backup""},
...
,{}
]
My LLD Macros ({#PORT}=$.[*]["6"]
ITEM Prototype has a Type Trapper
Name: portname"{#PORT}"
Type: Zabbix trapper
Key: port[{#PORT}]
Type of information:Text
If i execute the Discovery Role i get
"Cannot create item: item with the same key "port[{#PORT}]" already exists.
Cannot create item: item with the same key "port[{#PORT}]" already exists."
...
Comment