mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-14 01:41:25 -06:00
Fixed bug where a single host exception would stop the sync.
This commit is contained in:
parent
66f24e6891
commit
7bf72de0f9
@ -131,8 +131,8 @@ def main(arguments):
|
|||||||
nb_version = netbox.version
|
nb_version = netbox.version
|
||||||
|
|
||||||
# Go through all Netbox devices
|
# Go through all Netbox devices
|
||||||
try:
|
|
||||||
for nb_vm in netbox_vms:
|
for nb_vm in netbox_vms:
|
||||||
|
try:
|
||||||
vm = VirtualMachine(nb_vm, zabbix, netbox_journals, nb_version,
|
vm = VirtualMachine(nb_vm, zabbix, netbox_journals, nb_version,
|
||||||
create_journal, logger)
|
create_journal, logger)
|
||||||
vm.set_hostgroup(vm_hostgroup_format,netbox_site_groups,netbox_regions)
|
vm.set_hostgroup(vm_hostgroup_format,netbox_site_groups,netbox_regions)
|
||||||
@ -172,8 +172,11 @@ def main(arguments):
|
|||||||
# Add VM to Zabbix
|
# Add VM to Zabbix
|
||||||
vm.createInZabbix(zabbix_groups, zabbix_templates,
|
vm.createInZabbix(zabbix_groups, zabbix_templates,
|
||||||
zabbix_proxy_list)
|
zabbix_proxy_list)
|
||||||
|
except SyncError:
|
||||||
|
pass
|
||||||
|
|
||||||
for nb_device in netbox_devices:
|
for nb_device in netbox_devices:
|
||||||
|
try:
|
||||||
# Set device instance set data such as hostgroup and template information.
|
# Set device instance set data such as hostgroup and template information.
|
||||||
device = PhysicalDevice(nb_device, zabbix, netbox_journals, nb_version,
|
device = PhysicalDevice(nb_device, zabbix, netbox_journals, nb_version,
|
||||||
create_journal, logger)
|
create_journal, logger)
|
||||||
|
Loading…
Reference in New Issue
Block a user