# salt.states.zabbix_host

Warning

This module will be removed from Salt in version 3009 in favor of the zabbix Salt Extension.

Management of Zabbix hosts.

codeauthor:

  Jiri Kotlin <jiri.kotlin@ultimum.io>

salt.states.zabbix_host.absent(name, **kwargs)

  Ensures that the host does not exists, eventually deletes host.

  Added in version 2016.3.0.

  Param:

    name: technical name of the host

  Parameters:

    - _connection_user -- Optional - zabbix user (can also be set in opts or pillar, see module's docstring)

    - _connection_password -- Optional - zabbix password (can also be set in opts or pillar, see module's docstring)

    - _connection_url -- Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

      TestHostWithInterfaces:
          zabbix_host.absent

salt.states.zabbix_host.assign_templates(host, templates, **kwargs)

  Ensures that templates are assigned to the host.

  Added in version 2017.7.0.

  Parameters:

    - host -- technical name of the host

    - _connection_user -- Optional - zabbix user (can also be set in opts or pillar, see module's docstring)

    - _connection_password -- Optional - zabbix password (can also be set in opts or pillar, see module's docstring)

    - _connection_url -- Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

      add_zabbix_templates_to_host:
          zabbix_host.assign_templates:
              - host: TestHost
              - templates:
                  - "Template OS Linux"
                  - "Template App MySQL"

salt.states.zabbix_host.present(host, groups, interfaces, **kwargs)

  Ensures that the host exists, eventually creates new host. NOTE: please use argument visible_name instead of name to not mess with name from salt sls. This function accepts all standard host properties: keyword argument names differ depending on your zabbix version, see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host

  Added in version 2016.3.0.

  Parameters:

    - host -- technical name of the host

    - groups -- groupids of host groups to add the host to

    - interfaces -- interfaces to be created for the host

    - proxy_host -- Optional proxy name or proxyid to monitor host

    - inventory -- Optional list or dictionary of inventory names and values

    - _connection_user -- Optional - zabbix user (can also be set in opts or pillar, see module's docstring)

    - _connection_password -- Optional - zabbix password (can also be set in opts or pillar, see module's docstring)

    - _connection_url -- Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    - visible_name -- Optional - string with visible name of the host, use 'visible_name' instead of 'name' parameter to not mess with value supplied from Salt sls file.

    - inventory_clean -- Optional - Boolean value that selects if the current inventory will be cleaned and overwritten by the declared inventory list (True); or if the inventory will be kept and only updated with inventory list contents (False). Defaults to True

      create_test_host:
          zabbix_host.present:
              - host: TestHostWithInterfaces
              - proxy_host: 12345
              - groups:
                  - 5
                  - 6
                  - 7
              - interfaces:
                  - test1.example.com:
                      - ip: '192.168.1.8'
                      - type: 'Agent'
                      - port: 92
                  - testing2_create:
                      - ip: '192.168.1.9'
                      - dns: 'test2.example.com'
                      - type: 'agent'
                      - main: false
                  - testovaci1_ipmi:
                      - ip: '192.168.100.111'
                      - type: 'ipmi'
              - inventory:
                  - alias: some alias
                  - asset_tag: jlm3937