cuimingkun / zbx_tem_redis

33 stars 34 forks source link

Error on Zabbix 4.2 #10

Open jothoma1 opened 4 years ago

jothoma1 commented 4 years ago

Hi, i have imported the userparameters on my Redis and the template on zabbix server (currently in 4.2) but it doesn't work The error in discovery is weird :

Invalid discovery rule value: cannot find pair with name "{#SNMPVALUE}"

If you have any ideas ? I just imported your work and didnt modify anything Thanks in advance

r0mk commented 4 years ago

Hi! Reason in user permission in userparametres. zabbix-agent cant found listened port. There 2 ways to solve: 1)run zabbix-agent as root. Its bad idea 2)rewrite userparametre to parse config For example: UserParameter=redis.port.discovery,grep '^port ' /etc/redis/*.conf|awk '{print $2}'| awk NF | sed -e s/^/'{"{#REDIS_PORT}": "'/g -e s/'$'/'"},'/g | tr -d \n | sed -e s/^/'{"data":['/g -e s/',$'/]}/g