I get the error message: "Cannot create item: item with the same key "icmppingloss[{#IPADDR},10,100,64,64]" already exists.
The items show up, but if I try to make graph prototypes, they do not work and I think it is related to the error.
The thing is I am not using it twice so I don't understand the error. Here is some information on my discovery rule:
In the Discovery rule, i use the key site.ip.dscovery
for item prototypes, I use icmppingloss[{#IPADDR},10,100,64,64]
and will use #IPADDR1 and #IPADDR2
site-ip.sh (converts to JSON format.. the awk statements get me ip addresses)
site-ip.conf
The items show up, but if I try to make graph prototypes, they do not work and I think it is related to the error.
The thing is I am not using it twice so I don't understand the error. Here is some information on my discovery rule:
In the Discovery rule, i use the key site.ip.dscovery
for item prototypes, I use icmppingloss[{#IPADDR},10,100,64,64]
and will use #IPADDR1 and #IPADDR2
site-ip.sh (converts to JSON format.. the awk statements get me ip addresses)
Code:
#!/bin/bash
SITEIPADDR=`ifconfig -a | grep 172.16 | awk '{gsub("addr:", "");print $2}'`
TUNNEL1ADDR=`ifconfig -a | grep 10.10 | awk '{gsub("addr:", "");print $2}' | awk 'FNR == 1 {print}'`
TUNNEL2ADDR=`ifconfig -a | grep 10.10 | awk '{gsub("addr:", "");print $2}' | awk 'FNR == 2 {print}'`
echo -en "{\n"
echo -en "\t\"data\":[\n\n"
echo -en "\t{"
echo -en "\"{#IPADDR}\":\"$SITEIPADDR\""
echo -en "},\n";
echo -en "\t{"
echo -en "\"{#IPADDR1}\":\"$TUNNEL1ADDR\""
echo -en "},\n";
echo -en "\t{"
echo -en "\"{#IPADDR2}\":\"$TUNNEL2ADDR\""
echo -en "},\n";
echo -en "\n\t]\n"
echo -en "}\n"
Code:
UserParameter=site.ip.discovery,/etc/zabbix/site-ip.sh
Comment