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

[BUG]: zabbix_template.present results in an error: Incorrect API "templatescreen" #60566

Open
misch42 opened this issue Jul 18, 2021 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior salt-extensions

Comments

@misch42
Copy link
Contributor

misch42 commented Jul 18, 2021

Description
I want to create a new template in zabbix with the zabbix_template.present state. Copying and running a simplified example results in an error.

Setup

# cat zabix/create_template.sls
zabbix-template-present:
  zabbix_template.present:
    - name: Testing Template
    # Do not touch existing assigned hosts
    # True will detach all other hosts than defined here
    - static_host_list: False
    - params:
        description: Test Template
        groups:
            # groups must already exist
            # template must be at least in one hostgroup
            - groupid:
                query_object: hostgroup
                query_name: Templates

and running this state results in:

# salt 'myhost' state.apply zabbix.create_template debug=true
myhost:
----------
          ID: zabbix-template-present
    Function: zabbix_template.present
        Name: Testing Template
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.7/site-packages/salt/state.py", line 2154, in call
                  *cdata["args"], **cdata["kwargs"]
                File "/usr/lib/python3.7/site-packages/salt/loader.py", line 2087, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib64/python3.7/site-packages/salt/states/zabbix_template.py", line 798, in present
                  component, template_id, **kwargs
                File "/usr/lib64/python3.7/site-packages/salt/states/zabbix_template.py", line 329, in _get_existing_template_c_list
                  c_def["qtype"] + ".get", q_params, **kwargs
                File "/usr/lib64/python3.7/site-packages/salt/modules/zabbix.py", line 2558, in run_query
                  ret = _query(method, params, conn_args["url"], conn_args["auth"])
                File "/usr/lib64/python3.7/site-packages/salt/modules/zabbix.py", line 187, in _query
                  ret["error"]["message"], ret["error"]["data"]
              salt.exceptions.SaltException: Zabbix API: Invalid params. (Incorrect API "templatescreen".)

Steps to Reproduce the behavior
Zabbix 5.2
setup this state and run it.

Expected behavior
Should create the template without throwing an error.

Screenshots
Debug output see above.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
 # salt --versions-report
Salt Version:
           Salt: 3001.6
 
Dependency Versions:
           cffi: 1.14.0
       cherrypy: Not Installed
       dateutil: 2.8.1
      docker-py: Not Installed
          gitdb: 4.0.5
      gitpython: 3.1.8
         Jinja2: 2.11.2
        libgit2: 1.0.1
       M2Crypto: 0.36.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 1.0.0
   mysql-python: Not Installed
      pycparser: 2.20
       pycrypto: 3.9.8
   pycryptodome: 3.9.8
         pygit2: 1.3.0
         Python: 3.7.9 (default, Nov  3 2020, 12:10:17)
   python-gnupg: 0.4.6
         PyYAML: 5.3.1
          PyZMQ: 19.0.1
          smmap: 3.0.4
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.3
 
System Versions:
           dist: gentoo 2.7 
         locale: UTF-8
        machine: x86_64
        release: 4.9.74-grsecurity
         system: Linux
        version: Gentoo 2.7 

Additional context
Add any other context about the problem here.

@misch42 misch42 added Bug broken, incorrect, or confusing behavior needs-triage labels Jul 18, 2021
@s0undt3ch s0undt3ch removed their assignment Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior salt-extensions
Projects
None yet
Development

No branches or pull requests

3 participants