Closed misch42 closed 3 years ago
@misch42
This is not related to Salt, but with how the Zabbix API does the trigger match. It uses the expression
as part of match properties. Try to change, instead of the expression
, the priority
from WARNING
to HIGH
.
The behaviour of zabbix.run_query
is totally dependent of Zabbix API, it is a direct call, without treatment. To be fair with zabbix
execution module, the idempotent warranties are in the state modules, not the execution ones.
Thought that this might be an issue with the Zabbix API. Thanks for the clarification.
Update to the problem: rules.trigger also have an attribute deleteMissing. Setting this to true results in deleting the old trigger and adding a new one. i.e.:
params:
rules:
triggers:
updateExisting: true
createMissing: true
deleteMissing: true
Description running the zabbix.run_query with the configuation.import method to update a template does not work correcty. Instead of updating an existing trigger in a template it creates a new trigger in the template.
Setup state:
template:
applying the state once, works without problems. It creates the template within zabbix. But changing the expression from {last()}>0 to {last()}=0 it should update the existing trigger. But instead applying the state creates a new trigger with the same name but a different expression.
Steps to Reproduce the behavior See above.
Expected behavior The state should update the existing trigger to reflect the changed template.
Screenshots If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) ``` 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.