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

Failed to create action unexpected parameter formulaid #672

Closed
dicksol opened this issue Apr 14, 2022 · 2 comments
Closed

Failed to create action unexpected parameter formulaid #672

dicksol opened this issue Apr 14, 2022 · 2 comments

Comments

@dicksol
Copy link

dicksol commented Apr 14, 2022

SUMMARY

Using https://github.com/ansible-collections/community.zabbix/releases/tag/1.6.0 and trying to create an action in Zabbix 6.0 with value for formulaid results in error message:
Failed to create action : ('Error -32602: Invalid params., Invalid parameter, unexpected parameter formulaid
Without formulaid the action is created.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.zabbix.zabbix_action

ANSIBLE VERSION
$ ansible --version
ansible 2.9.27
  config file = /home/xxxx/yyyyy/.ansible.cfg
  configured module search path = ['/home/xxxx/yyyyy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Sep  9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
CONFIGURATION
$ ansible-config dump --only-changed
DEFAULT_CALLBACK_WHITELIST(/home/xxxxx/.ansible.cfg) = ['profile_tasks']
DEFAULT_FORKS(/home/xxxx/.ansible.cfg) = 15
DEFAULT_HOST_LIST(/home/xxxx/.ansible.cfg) = ['/etc/ansible/inventory']
DEFAULT_POLL_INTERVAL(/home/xxxx/.ansible.cfg) = 15
DEFAULT_TRANSPORT(/home/xxxx/.ansible.cfg) = smart
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
INVENTORY_ENABLED(/home/xxxx/.ansible.cfg) = ['yaml', 'ini']
INVENTORY_IGNORE_EXTS(/home/xxxx/.ansible.cfg) = ['.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt', '~', '.orig', '.cfg', '.retry']
OS / ENVIRONMENT / Zabbix Version

RHEL8 and AWX

STEPS TO REPRODUCE
  - name: Deploy HWS MS Teams Application trigger action
    community.zabbix.zabbix_action:
      server_url: "{{ zabbix_url }}"
      login_user: svc-tabwm
      login_password: "{{ zabbix_password }}"
      validate_certs: "{{ validate_certs }}"
      name: "HWS MS Teams Application action"
      event_source: 'trigger'
      state: present
      status: enabled
      esc_period: '3600'
      conditions:
        - type: 'host_group'
          operator: '='
          value: 'HWS'
          formulaid: A
      operations:
        - type: send_message
          subject: "Applicatie Verstoring"
          send_to_users:
            - 'HWS MS Teams Alert User'
      recovery_operations:
        - type: send_message
          subject: "Applicatie Verstoring Opgelost"
          send_to_users:
            - 'HWS MS Teams Alert User'
EXPECTED RESULTS

Action created in Zabbix 6.0

ACTUAL RESULTS
TASK [Deploy HWS MS Teams Application trigger action] *************************************************************************************************************************************
Thursday 14 April 2022  21:10:59 +0200 (0:00:09.631)       0:00:31.339 ********
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to create action 'HWS MS Teams Application action': ('Error -32602: Invalid params., Invalid parameter \"/1/filter/conditions/1\": unexpected parameter \"formulaid\". while sending {\"jsonrpc\": \"2.0\", \"method\": \"action.create\", \"params\": {\"name\": \"HWS MS Teams Application action\", \"eventsource\      ": \"0\", \"filter\": {\"conditions\": [{\"conditiontype\": \"0\", \"value\": \"84\", \"formulaid\": \"A\", \"operator\": \"0\"}], \"evaltype\": \"0\"}, \"operations\": [{\"operationtype\": \"      0\", \"opmessage\": {\"default_msg\": \"0\", \"mediatypeid\": \"0\", \"subject\": \"Applicatie Verstoring\"}, \"opmessage_usr\": [{\"userid\": \"51\"}]}], \"recovery_operations\": [{\"ope      rationtype\": \"0\", \"opmessage\": {\"default_msg\": \"0\", \"subject\": \"Applicatie Verstoring Opgelost\"}, \"opmessage_usr\": [{\"userid\": \"51\"}]}], \"status\": \"0\", \"pause_supp      ressed\": \"1\"}, \"auth\": \"d546ed0f8d9b83da3e28bb2b6e016535\", \"id\": 3}', -32602)"}
@BGmot
Copy link
Collaborator

BGmot commented Apr 20, 2022

Look at #661
formula_id is mentioned there and seems to be valid in 6.0 only with evaltype="custom expression"

@dicksol
Copy link
Author

dicksol commented Apr 21, 2022

Sorted, Tx.

@dicksol dicksol closed this as completed Apr 21, 2022
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