mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 04:02:56 -06:00
Added support for hardcoded strings in hostgroups
This commit is contained in:
parent
57c7f83e6a
commit
98c13919c5
@ -117,6 +117,11 @@ class Hostgroup:
|
||||
for hg_item in hg_items:
|
||||
# Check if requested data is available as option for this host
|
||||
if hg_item not in self.format_options:
|
||||
if hg_item.startswith(("'", '"')) and hg_item.endswith(("'", '"')):
|
||||
hg_item = hg_item.strip("\'")
|
||||
hg_item = hg_item.strip('\"')
|
||||
hg_output.append(hg_item)
|
||||
else:
|
||||
# Check if a custom field exists with this name
|
||||
cf_data = self.custom_field_lookup(hg_item)
|
||||
# CF does not exist
|
||||
|
@ -160,6 +160,7 @@ def verify_hg_format(
|
||||
if (
|
||||
hg_object not in allowed_objects[hg_type]
|
||||
and hg_object not in allowed_objects["cfs"][hg_type]
|
||||
and not hg_object.startswith(('"',"'"))
|
||||
):
|
||||
e = (
|
||||
f"Hostgroup item {hg_object} is not valid. Make sure you"
|
||||
|
Loading…
Reference in New Issue
Block a user