Closed banzayats closed 8 years ago
Thank you for reporting! It seems that this error is occured not to get item data from itemid(34813) through Zabbix API.
Please check the following information.
Best regards
My Zabbix is using another url, so I've passed it to the script:
# /zabbix_anomaly-linux-amd64 -h localhost -u http://localhost/api_jsonrpc.php -u Admin -pass zabbix -i 34813
But the error still here:
panic: interface conversion: interface is nil, not []interface {}
goroutine 1 [running]:
panic(0x792540, 0xc82000e900)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
main.main()
/root/go_work/src/github.com/zabbix_anomaly/zabbix_anomaly.go:97 +0xbff
Can you connect to http://localhost/api_jsonrpc.php from your Zabbix server?
for example,
# curl -H "Content-Type: application/json-rpc" -d '{"jsonrpc": "2.0","method": "user.login","params": {"user": "Admin","password": "zabbix"},"id": 1}' http://localhost/api_jsonrpc.php
Can you get auth token?
Yes:
{"jsonrpc":"2.0","result":"b12789c4c8b7a79963285735ff06df92","id":1}
thanks trying. itemid 34813 is right?
I've tried different item ids but always got the same error.
ok. Please wait a momemt. I will change the code for debbuging(output error message).
and, please tell me your Zabbix version.
Zabbix 3.0.3
I have released new pre-release version adding error handling. https://github.com/ike-dai/zabbix_anomaly/releases/tag/0.0.2
Please try this version. And please send me the cli output result.
Hello. I've got the following error:
[ERROR]: zabbix api login error: Post Admin: unsupported protocol scheme ""
Thank you for trying. I think that this error occurred the wrong url. Please check -u option. At this option, some space might be included.
Thank you for your response. The problem was the duplicated parameters:
zabbix_anomaly-linux-amd64 -h localhost -u http://localhost/api_jsonrpc.php -u Admin -pass zabbix -i 34813
I'm getting the following error when running program from command line:
# ./zabbix_anomaly-linux-amd64 -i 34813 -user zabbix -pass zabbix -interval 60