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 -32500: Application error #52

Open
mg1boc1 opened this issue Aug 16, 2021 · 2 comments

Comments

@mg1boc1
Copy link

mg1boc1 commented Aug 16, 2021

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 "*****"

{code}

Traceback (most recent call last):
  File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 193, in <module>
    main()
  File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 184, in main
    register_action(client, mediatype_id, options, action_id)
  File "/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py", line 126, in register_action
    "mediatypeid": mediatype_id,
  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 -32500: Application error., SQL statement execution has failed "INSERT INTO opmessage (default_msg,mediatypeid,operationid) VALUES (\'1\',\'6\',\'24\')". while sending {\'jsonrpc\': \'2.0\', \'method\': \'action.create\', \'params\': {\'name\': \'Dispatching to StackStorm\', \'esc_period\': 360, \'eventsource\': 0, \'def_shortdata\': \'{TRIGGER.STATUS}: {TRIGGER.NAME}\', \'def_longdata\': \'{"event": {"id": "{EVENT.ID}", "time": "{EVENT.TIME}"}, "trigger": {"id": "{TRIGGER.ID}", "name": "{TRIGGER.NAME}", "status": "{TRIGGER.STATUS}"}, "items": [{"name": "{ITEM.NAME1}", "host": "{HOST.NAME1}", "key": "{ITEM.KEY1}", "value": "{ITEM.VALUE1}"}, {"name": "{ITEM.NAME2}", "host": "{HOST.NAME2}", "key": "{ITEM.KEY2}", "value": "{ITEM.VALUE2}"}, {"name": "{ITEM.NAME3}", "host": "{HOST.NAME3}", "key": "{ITEM.KEY3}", "value": "{ITEM.VALUE3}"}, {"name": "{ITEM.NAME4}", "host": "{HOST.NAME4}", "key": "{ITEM.KEY4}", "value": "{ITEM.VALUE4}"}, {"name": "{ITEM.NAME5}", "host": "{HOST.NAME5}", "key": "{ITEM.KEY5}", "value": "{ITEM.VALUE5}"}, {"name": "{ITEM.NAME6}", "host": "{HOST.NAME6}", "key": "{ITEM.KEY6}", "value": "{ITEM.VALUE6}"}, {"name": "{ITEM.NAME7}", "host": "{HOST.NAME7}", "key": "{ITEM.KEY7}", "value": "{ITEM.VALUE7}"}, {"name": "{ITEM.NAME8}", "host": "{HOST.NAME8}", "key": "{ITEM.KEY8}", "value": "{ITEM.VALUE8}"}]}\', \'operations\': [{\'operationtype\': 0, \'esc_period\': 0, \'esc_step_from\': 1, \'esc_step_to\': 1, \'evaltype\': 0, \'opmessage_usr\': [{\'userid\': \'1\'}], \'opmessage\': {\'default_msg\': 1, \'mediatypeid\': \'6\'}}]}, \'id\': \'1\', \'auth\': \'9f792f80b082a0e92b1f88c38790ecde\'}', -32500)

{code}

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

@namachieli
Copy link
Collaborator

Hi, What version of Zabbix, Stackstorm, and the zabbix pack are you using?

@mg1boc1
Copy link
Author

mg1boc1 commented Aug 16, 2021

Hi, we use the following software versions:
CentOS Linux release 8.4.2105
Zabbix Version 5.4.3
st2 Version 3.5.0, on Python 3.6.8
Zabbix Pack Version 1.0.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

2 participants