Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register_st2_config_to_zabbix.py script failing with Error -32602: Invalid params #44

Open
hv024036dba opened this issue Nov 9, 2020 · 2 comments

Comments

@hv024036dba
Copy link

Hello All,

I'm trying to integrate zabbix with stack storm and the integration is failing when i am trying to run the script
/opt/stackstorm/virtualenvs/zabbix/bin/python /opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py -z http://.../zabbix -u "Admin" -p "*****"

Error:

{code}

opt/stackstorm/virtualenvs/zabbix/bin/python /opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py -z http://.../zabbix -u "Admin" -p "*****"
Traceback (most recent call last):
File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 191, in
main()
File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 176, in main
mediatype_id = register_media_type(client, options, mediatype_id)
File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 83, in register_media_type
ret = client.mediatype.create(**params)
File "/opt/stackstorm/virtualenvs/zabbix/lib/python3.6/site-packages/pyzabbix/api.py", line 82, in fn
args or kwargs
File "/opt/stackstorm/virtualenvs/zabbix/lib/python3.6/site-packages/pyzabbix/api.py", line 250, in do_request
raise ZabbixAPIException(msg, err['code'])
pyzabbix.api.ZabbixAPIException: ("Error -32602: Invalid params., Media type is missing parameters: name while sending {'jsonrpc': '2.0', 'method': 'mediatype.create', 'params': {'description': 'StackStorm', 'type': '1', 'exec_path': 'st2_dispatch.py', 'exec_params': '-- CHANGE ME : api_url (e.g. https://st2-node/api/v1)\\n-- CHANGE ME : auth_url (e.g. https://st2-node/auth/v1)\\n-- CHANGE ME : login uername of StackStorm --\n-- CHANGE ME : login password of StackStorm --\n{ALERT.SENDTO}\n{ALERT.SUBJECT}\n{ALERT.MESSAGE}\n'}, 'id': '1', 'auth': 'b7e4b784f8dc6a930eccf97471f2b39'}", -32602)
root@stockstorm:~#

{code}

I passed the zabbix login credentials correctly like wise before performing the actions i login to st2ctl from backend node

@pqespindola
Copy link

There were changes to the mediatype object from Zabbix 4.2 to 4.4:
ZBXNEXT-5426 renamed “description” property to “name”

I changed "description" to "name" in register_st2_config_to_zabbix.py and it worked for me.

@Maiky28
Copy link

Maiky28 commented Aug 30, 2022

I'm facing the same issue. I've been looking for the solution for several days without positive results.
I have Zabbix 6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants