Ad Widget

Collapse

Export/import unique dependencies over templated triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kva
    Junior Member
    • Sep 2018
    • 5

    #1

    Export/import unique dependencies over templated triggers


    Hello.
    I'm using zabbix 3.4.12
    I'm adding hosts via icmp discovery and then automaticly attach template to them. Also I can manualy add dependency for each templated trigger (e.g. I have templated icmp availability for host x, but I can add unique dependency to it, for example, router availability in wich this exact host is plugged in, so when router is also down, this host x wont create alerts). Now I want to automate this process too, since I know hierarchy of network and I suppose I need to write some external scripts for this, but main question is:
    How do I export and import that data to zabbix? When I export item with templated triggers and custom (unique) dependency added over template, it won't export dependency, only template name.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <zabbix_export>
    <version>3.4</version>
    <date>2020-05-28T09:08:08Z</date>
    <groups>
    <group>
    <name>Discovered hosts</name>
    </group>
    <group>
    <name>GROUPNAME</name>
    </group>
    </groups>
    <hosts>
    <host>
    <host>192.168.1.1</host>
    <name>192.168.1.1 MYHOST</name>
    <description/>
    <proxy>
    <name>myproxy</name>
    </proxy>
    <status>0</status>
    <ipmi_authtype>-1</ipmi_authtype>
    <ipmi_privilege>2</ipmi_privilege>
    <ipmi_username/>
    <ipmi_password/>
    <tls_connect>1</tls_connect>
    <tls_accept>1</tls_accept>
    <tls_issuer/>
    <tls_subject/>
    <tls_psk_identity/>
    <tls_psk/>
    <templates>
    <template>
    <name>my_template_name</name>
    </template>
    </templates>
    <groups>
    <group>
    <name>Discovered hosts</name>
    </group>
    <group>
    <name>GROUPNAME</name>
    </group>
    </groups>
    <interfaces>
    <interface>
    <default>1</default>
    <type>1</type>
    <useip>1</useip>
    <ip>192.168.1.1</ip>
    <dns/>
    <port>10050</port>
    <bulk>1</bulk>
    <interface_ref>if1</interface_ref>
    </interface>
    </interfaces>
    <applications/>
    <items/>
    <discovery_rules/>
    <httptests/>
    <macros/>
    <inventory>
    ...
    </inventory>
    </host>
    </hosts>
    </zabbix_export>
    Click image for larger version

Name:	zabbix.png
Views:	175
Size:	25.6 KB
ID:	402222
Working...