Hi,
I have a template with an LLD rule (specifically, the "classic" network interface discovery one. I'm trying to update it with additional filters - I want to only get interfaces with specific properties.
So, I wanted to update the template itself, and have the changes impact all the hosts.
Here is what I did (I'm doing this via Python API calls):
discoveryrule.get(output='extend', templateid=template_id), where "template_id" is... the template id
I expected to get a single entry, for the template that I have. Instead I got 10+ entries, I think one for each host - here are three of the lines:
Why is that? How can I get just the template and update it?
Anyhow, putting that aside, I then figured I'd just update them, all, with
discoveryrule.update(itemid=itemid, filter=interface_filter)
But I don't see any impact...
help...?
I have a template with an LLD rule (specifically, the "classic" network interface discovery one. I'm trying to update it with additional filters - I want to only get interfaces with specific properties.
So, I wanted to update the template itself, and have the changes impact all the hosts.
Here is what I did (I'm doing this via Python API calls):
discoveryrule.get(output='extend', templateid=template_id), where "template_id" is... the template id
I expected to get a single entry, for the template that I have. Instead I got 10+ entries, I think one for each host - here are three of the lines:
Code:
** next rule: {u'itemid': u'22444', u'username': u'', u'snmpv3_contextname': u'', u'inventory_link': u'0', u'multiplier': u'0', u'authtype': u'0', u'trends': u'0', u'snmpv3_authpassphrase': u'', u'snmp_oid': u'', u'templateid': u'0', u'snmpv3_securitylevel': u'0', u'port': u'', u'password': u'', u'logtimefmt': u'', u'mtime': u'0', u'delay': u'3600', u'publickey': u'', u'state': u'0', u'params': u'', u'snmpv3_securityname': u'', u'type': u'0', u'snmpv3_authprotocol': u'0', u'status': u'0', u'lastlogsize': u'0', u'snmp_community': u'', u'description': u'Discovery of network interfaces as defined in global regular expression "Network interfaces for discovery".', u'data_type': u'0', u'trapper_hosts': u'', u'units': u'', u'value_type': u'4', u'delta': u'0', u'snmpv3_privprotocol': u'0', u'delay_flex': u'', u'interfaceid': u'0', u'snmpv3_privpassphrase': u'', u'hostid': u'10001', u'key_': u'net.if.discovery', u'name': u'Network interface discovery', u'privatekey': u'', u'lifetime': u'30', u'valuemapid': u'0', u'flags': u'1', u'error': u'', u'ipmi_sensor': u'', u'history': u'90'}
** next rule: {u'itemid': u'22944', u'username': u'', u'snmpv3_contextname': u'', u'inventory_link': u'0', u'multiplier': u'0', u'authtype': u'0', u'trends': u'0', u'snmpv3_authpassphrase': u'', u'snmp_oid': u'', u'templateid': u'0', u'snmpv3_securitylevel': u'0', u'port': u'', u'password': u'', u'logtimefmt': u'', u'mtime': u'0', u'delay': u'3600', u'publickey': u'', u'state': u'0', u'params': u'', u'snmpv3_securityname': u'', u'type': u'0', u'snmpv3_authprotocol': u'0', u'status': u'0', u'lastlogsize': u'0', u'snmp_community': u'', u'description': u'Discovery of network interfaces as defined in global regular expression "Network interfaces for discovery".', u'data_type': u'0', u'trapper_hosts': u'', u'units': u'', u'value_type': u'4', u'delta': u'0', u'snmpv3_privprotocol': u'0', u'delay_flex': u'', u'interfaceid': u'0', u'snmpv3_privpassphrase': u'', u'hostid': u'10076', u'key_': u'net.if.discovery', u'name': u'Network interface discovery', u'privatekey': u'', u'lifetime': u'30', u'valuemapid': u'0', u'flags': u'1', u'error': u'', u'ipmi_sensor': u'', u'history': u'90'}
** next rule: {u'itemid': u'22984', u'username': u'', u'snmpv3_contextname': u'', u'inventory_link': u'0', u'multiplier': u'0', u'authtype': u'0', u'trends': u'0', u'snmpv3_authpassphrase': u'', u'snmp_oid': u'', u'templateid': u'0', u'snmpv3_securitylevel': u'0', u'port': u'', u'password': u'', u'logtimefmt': u'', u'mtime': u'0', u'delay': u'3600', u'publickey': u'', u'state': u'0', u'params': u'', u'snmpv3_securityname': u'', u'type': u'0', u'snmpv3_authprotocol': u'0', u'status': u'0', u'lastlogsize': u'0', u'snmp_community': u'', u'description': u'Discovery of network interfaces as defined in global regular expression "Network interfaces for discovery".', u'data_type': u'0', u'trapper_hosts': u'', u'units': u'', u'value_type': u'4', u'delta': u'0', u'snmpv3_privprotocol': u'0', u'delay_flex': u'', u'interfaceid': u'0', u'snmpv3_privpassphrase': u'', u'hostid': u'10077', u'key_': u'net.if.discovery', u'name': u'Network interface discovery', u'privatekey': u'', u'lifetime': u'30', u'valuemapid': u'0', u'flags': u'1', u'error': u'', u'ipmi_sensor': u'', u'history': u'90'}
Why is that? How can I get just the template and update it?
Anyhow, putting that aside, I then figured I'd just update them, all, with
discoveryrule.update(itemid=itemid, filter=interface_filter)
But I don't see any impact...
help...?
Comment