Module Expr Str ImportFrom alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args defaults body Expr Str Return CompareIn Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Assign NameStore Dict Str Str Str Str NameLoad Dict NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Dict NameLoad Dict Str Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return Call NameLoad Assign NameStore TupleLoad Str Str Str Str Str Str Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body For NameStore NameLoad body Assign NameStore NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad For NameStore SubscriptLoad NameLoad Index NameLoad body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad Assign NameStore Call NameLoad Assign NameStore Dict Str Str Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Call AttributeLoad SubscriptLoad NameLoad Index Str attr Index Num Assign NameStore IfExp CompareEq Call AttributeLoad Call NameLoad Call AttributeLoad NameLoad attr Str Str attr Str Str Str Assign NameStore IfExp CompareEq Call AttributeLoad Call NameLoad Call AttributeLoad NameLoad attr Str Str attr Str Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Call AttributeLoad SubscriptLoad NameLoad Index Str attr Index Num Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Str keyword NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad If NameLoad body Assign NameStore SubscriptLoad Call SubscriptLoad NameLoad Index Str keyword NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpAdd ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad If NameLoad body Assign NameStore NameLoad orelse If BoolOpAnd UnaryOpNot NameLoad NameLoad body Assign NameStore NameLoad If SubscriptLoad NameLoad Index Str body If NameLoad body If BoolOpOr NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore ListLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If BoolOpOr NameLoad NameLoad body If NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str Call NameLoad NameLoad If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If NameLoad body If NameLoad body For NameStore NameLoad body Expr Call SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad SubscriptLoad Call SubscriptLoad NameLoad Index Str keyword NameLoad Index Num Index Str For NameStore NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If NameLoad body Assign SubscriptStore NameLoad Index Str Dict Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str NameLoad Dict NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Dict NameLoad Dict Str Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad If SubscriptLoad NameLoad Index Str body If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse TryExcept body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad If BoolOpAnd NameLoad CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Call NameLoad SubscriptLoad NameLoad Index Str Return NameLoad decorator_list
N/A N/A 
Management of Zabbix hosts.

:codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io>


 __future__ absolute_import json loads dumps copy deepcopy __virtual__ N/A N/A N/A N/A N/A 
    Only make these states available if Zabbix module is available.
     N/A N/A zabbix.host_create __salt__ N/A present N/A N/A host groups interfaces N/A kwargs N/A N/A 
    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

    .. versionadded:: 2016.3.0

    :param host: technical name of the host
    :param groups: groupids of host groups to add the host to
    :param interfaces: interfaces to be created for the host
    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)
    :param 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.

    .. code-block:: yaml

        create_test_host:
            zabbix_host.present:
                - host: TestHostWithInterfaces
                - 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'


     N/A ret N/A name changes result comment host N/A False N/A comment_host_created N/A N/A Host {0} created. format host N/A comment_host_updated N/A N/A Host {0} updated. format host N/A comment_host_notcreated N/A N/A Unable to create host: {0}.  format host N/A comment_host_exists N/A N/A Host {0} already exists. format host N/A changes_host_created N/A host N/A old new N/A N/A Host {0} does not exist. format host N/A N/A Host {0} created. format host _interface_format N/A N/A interfaces_data N/A N/A N/A 
        Formats interfaces from SLS file into valid JSON usable for zabbix API.
        Completes JSON with default values.

        :param interfaces_data: list of interfaces data from SLS file

         N/A N/A interfaces_data N/A N/A N/A list N/A interface_attrs N/A ip dns main type useip port N/A interfaces_json N/A loads N/A dumps interfaces_data N/A interfaces_dict N/A dict N/A interface interfaces_json N/A N/A intf interface N/A N/A intf_name intf N/A N/A interfaces_dict N/A intf_name N/A dict N/A intf_val N/A interface N/A intf N/A N/A N/A key value N/A N/A intf_val items N/A N/A N/A key interface_attrs N/A N/A N/A N/A interfaces_dict N/A intf_name N/A key value N/A interfaces_list N/A list N/A interface_ports N/A agent snmp ipmi jmx N/A 1 10050 N/A 2 161 N/A 3 623 N/A 4 12345 N/A N/A key value N/A N/A interfaces_dict items N/A N/A interface_type N/A N/A interface_ports N/A N/A N/A N/A value N/A type lower N/A 0 N/A main N/A N/A N/A N/A N/A str N/A N/A value get main true lower true 1 0 N/A useip N/A N/A N/A N/A N/A str N/A N/A value get useip true lower true 1 0 N/A interface_ip N/A N/A value get ip N/A dns N/A N/A value get dns key N/A port N/A str N/A N/A value get port N/A N/A interface_ports N/A N/A N/A N/A value N/A type lower N/A 1 N/A N/A N/A interfaces_list append N/A type main useip ip dns port interface_type main useip interface_ip dns port N/A interfaces_list interfaces_list N/A interfaces_list_sorted N/A sorted interfaces_list key N/A N/A N/A k N/A N/A k N/A main reverse True N/A interfaces_list_sorted N/A N/A interfaces_formated N/A _interface_format interfaces N/A host_exists N/A N/A __salt__ N/A zabbix.host_exists host N/A host_exists N/A N/A host N/A N/A N/A __salt__ N/A zabbix.host_get name host N/A 0 N/A hostid N/A host N/A hostid N/A update_hostgroups False N/A update_interfaces False N/A hostgroups N/A N/A __salt__ N/A zabbix.hostgroup_get hostids hostid N/A cur_hostgroups N/A list N/A hostgroup hostgroups N/A N/A N/A N/A cur_hostgroups append N/A int N/A hostgroup N/A groupid N/A N/A N/A set groups N/A set cur_hostgroups N/A N/A update_hostgroups True N/A hostinterfaces N/A N/A __salt__ N/A zabbix.hostinterface_get hostids hostid N/A hostinterfaces N/A N/A hostinterfaces N/A sorted hostinterfaces key N/A N/A N/A k N/A N/A k N/A main N/A hostinterfaces_copy N/A deepcopy hostinterfaces N/A hostintf hostinterfaces_copy N/A N/A N/A N/A hostintf pop interfaceid N/A N/A N/A hostintf pop bulk N/A N/A N/A hostintf pop hostid N/A interface_diff N/A N/A x N/A x interfaces_formated N/A x hostinterfaces_copy N/A y N/A y hostinterfaces_copy N/A y interfaces_formated N/A interface_diff N/A N/A update_interfaces True N/A N/A N/A N/A hostinterfaces interfaces N/A N/A update_interfaces True N/A N/A __opts__ N/A test N/A N/A host_exists N/A N/A N/A update_hostgroups update_interfaces N/A N/A N/A ret N/A result None N/A N/A ret N/A comment comment_host_updated N/A N/A N/A ret N/A result True N/A N/A ret N/A comment comment_host_exists N/A N/A N/A ret N/A result None N/A N/A ret N/A comment comment_host_created N/A N/A ret N/A changes changes_host_created N/A ret N/A error N/A N/A host_exists N/A N/A N/A ret N/A result True N/A N/A update_hostgroups update_interfaces N/A N/A update_hostgroups N/A N/A hostupdate N/A N/A __salt__ N/A zabbix.host_update hostid groups groups N/A N/A N/A ret N/A changes N/A groups N/A str groups N/A N/A error hostupdate N/A N/A N/A N/A error append N/A hostupdate N/A error N/A update_interfaces N/A N/A hostinterfaces N/A N/A interface hostinterfaces N/A N/A N/A N/A __salt__ N/A zabbix.hostinterface_delete interfaceids N/A interface N/A interfaceid N/A hostid N/A N/A N/A N/A __salt__ N/A zabbix.host_get name host N/A 0 N/A hostid N/A interface interfaces_formated N/A N/A updatedint N/A N/A __salt__ N/A zabbix.hostinterface_create hostid hostid ip N/A interface N/A ip dns N/A interface N/A dns main N/A interface N/A main type N/A interface N/A type useip N/A interface N/A useip port N/A interface N/A port N/A N/A error updatedint N/A N/A N/A N/A error append N/A updatedint N/A error N/A N/A N/A ret N/A changes N/A interfaces N/A str interfaces_formated N/A N/A ret N/A comment comment_host_updated N/A N/A N/A ret N/A comment comment_host_exists N/A N/A host_create N/A N/A __salt__ N/A zabbix.host_create host groups interfaces_formated kwargs N/A N/A error host_create N/A N/A N/A ret N/A result True N/A N/A ret N/A comment comment_host_created N/A N/A ret N/A changes changes_host_created N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A comment_host_notcreated N/A str N/A host_create N/A error N/A error N/A N/A N/A ret N/A changes N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A str error N/A ret N/A absent N/A N/A name N/A N/A N/A 
    Ensures that the host does not exists, eventually deletes host.

    .. versionadded:: 2016.3.0

    :param: name: technical name of the host
    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    .. code-block:: yaml

        TestHostWithInterfaces:
            zabbix_host.absent

     N/A ret N/A name changes result comment name N/A False N/A comment_host_deleted N/A N/A Host {0} deleted. format name N/A comment_host_notdeleted N/A N/A Unable to delete host: {0}.  format name N/A comment_host_notexists N/A N/A Host {0} does not exist. format name N/A changes_host_deleted N/A name N/A old new N/A N/A Host {0} exists. format name N/A N/A Host {0} deleted. format name N/A host_exists N/A N/A __salt__ N/A zabbix.host_exists name N/A N/A __opts__ N/A test N/A N/A N/A host_exists N/A N/A N/A ret N/A result True N/A N/A ret N/A comment comment_host_notexists N/A N/A N/A ret N/A result None N/A N/A ret N/A comment comment_host_deleted N/A ret N/A host_get N/A N/A __salt__ N/A zabbix.host_get name N/A N/A host_get N/A N/A N/A ret N/A result True N/A N/A ret N/A comment comment_host_notexists N/A N/A N/A N/A hostid N/A N/A host_get N/A 0 N/A hostid N/A host_delete N/A N/A __salt__ N/A zabbix.host_delete hostid N/A N/A N/A KeyError N/A N/A host_delete False N/A N/A host_delete N/A error host_delete N/A N/A N/A ret N/A result True N/A N/A ret N/A comment comment_host_deleted N/A N/A ret N/A changes changes_host_deleted N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A comment_host_notdeleted N/A str N/A host_delete N/A error N/A ret N/A