Skip to content

Conversation

@slivik
Copy link
Contributor

@slivik slivik commented Apr 30, 2018

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

@cachedout
Copy link
Contributor

@jirikotlin Can you look some of this over? I know you've done a lot of work in this area.

'''
.. versionadded:: 2017.7
Imports Zabbix configuration sepcified in file to Zabbix server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: specified

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}'
Copy link
Contributor

@mchugh19 mchugh19 Apr 30, 2018

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

slivik added 2 commits May 2, 2018 09:44
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):
Copy link
Contributor

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?

Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants