-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add state modules for Zabbix templates, actions and valuemaps #47398
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
Conversation
|
@jirikotlin Can you look some of this over? I know you've done a lot of work in this area. |
salt/modules/zabbix.py
Outdated
| ''' | ||
| .. versionadded:: 2017.7 | ||
| Imports Zabbix configuration sepcified in file to Zabbix server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling: specified
salt/modules/zabbix.py
Outdated
| salt '*' zabbix.host_create technicalname 4 | ||
| interfaces='{type: 1, main: 1, useip: 1, ip: "192.168.3.1", dns: "", port: 10050}' | ||
| visible_name='Host Visible Name' inventory_mode=0 inventory='{"alias": "something"}' | ||
| interfaces='{if_type: 1, main: 1, useip: 1, ip_: "192.168.3.1", dns: "", port: 10050}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the gain from the change in user facing syntax? Does this require updates to the zabbix_host state? This line also clobbers an example of setting inventory information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my mistake. Will fix it in next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Zabbix API uses the following for interfaces in host.create:
"interfaces": [
{
"type": 1,
"main": 1,
"useip": 1,
"ip": "192.168.3.1",
"dns": "",
"port": "10050"
}
]
Why the change to if_type and ip_? This will affect user configurations and existing states, so is the rename necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it was a typo. Please, see my last commit where it is fixed.
Merge branch 'zabbix_template_state' of https://github.com/slivik/salt into zabbix_template_state
|
|
||
|
|
||
| def hostinterface_create(hostid, ip, dns='', main=1, type=1, useip=1, port=None, **connection_args): | ||
| def hostinterface_create(hostid, ip_, dns='', main=1, if_type=1, useip=1, port=None, **connection_args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this still be ip_ and if_type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in this case it is correct since Salt coding style (and pylint) says at least three characters for variable name and "type" is reserved Python keyword.
What does this PR do?
Adds functions to existing Zabbix module, test and docs related to newly added state modules for Zabbix templates, actions and value maps.
What issues does this PR fix or reference?
None
Tests written?
Yes
Commits signed with GPG?
Yes