Hi!
I'm new to Zabbix and this forum but I'm trying to help out, both myself and others. After having used a bunch of templates and miners to my own Zabbix 3.2 installation working as well as it does I decided it was time to pay back a little and create my own template and script for something that no one else has yet posted (that I could find).
I used this package as an example:
I am looking to create a discovery that launches a PHP script that queries an API from my VoIP provider (voip.ms) and gathers the status of all the VoIP accounts I monitor. The PHP script works fine and I noticed it was easier to launch a bash script that launches the PHP script then to try to make Zabbix run the PHP script directly and those parts of it seem to work well.
Now I seem to be running into the same problem as this post, except my JSON output already looks correct according to that post:
I am getting 'Value should be a JSON object.' back from my discovery. I tried looking through the database to see if I could find some logs about how Zabbix is trying to run the script so I could more accurately simulate the running myself and maybe correct how the script runs, but I couldn't find anything. I also couldn't find any log files that contained anything about the running of the discovery rules at all.
I get that the JSON may be invalid so here is the CLI:
I'm not sure what else it wants exactly from the output but I'll share the code if needed as well.
Please help.
I'm new to Zabbix and this forum but I'm trying to help out, both myself and others. After having used a bunch of templates and miners to my own Zabbix 3.2 installation working as well as it does I decided it was time to pay back a little and create my own template and script for something that no one else has yet posted (that I could find).
I used this package as an example:
I am looking to create a discovery that launches a PHP script that queries an API from my VoIP provider (voip.ms) and gathers the status of all the VoIP accounts I monitor. The PHP script works fine and I noticed it was easier to launch a bash script that launches the PHP script then to try to make Zabbix run the PHP script directly and those parts of it seem to work well.
Now I seem to be running into the same problem as this post, except my JSON output already looks correct according to that post:
I am getting 'Value should be a JSON object.' back from my discovery. I tried looking through the database to see if I could find some logs about how Zabbix is trying to run the script so I could more accurately simulate the running myself and maybe correct how the script runs, but I couldn't find anything. I also couldn't find any log files that contained anything about the running of the discovery rules at all.
I get that the JSON may be invalid so here is the CLI:
Code:
/usr/lib/zabbix/externalscripts$ ./voipAccountDiscover.sh <username> <password>
{ "data": [{"{#ACCOUNT}": "account name 1"},{"{#ACCOUNT}": "account name 2"},{"{#ACCOUNT}": "account name 3"},{"{#ACCOUNT}": "account name 4"},{"{#ACCOUNT}": "account name 5"},{"{#ACCOUNT}": "account name 6"},{"{#ACCOUNT}": "account name 7"}] }
Please help.
Comment