Skip to content

Instantly share code, notes, and snippets.

@dnaeon
Created May 12, 2015 06:51
Show Gist options
  • Save dnaeon/0acec0a6d9c79b084290 to your computer and use it in GitHub Desktop.
Save dnaeon/0acec0a6d9c79b084290 to your computer and use it in GitHub Desktop.
vpoller-issue-128
diff --git a/extra/zabbix/vsphere-import/zabbix-vsphere-import b/extra/zabbix/vsphere-import/zabbix-vsphere-import
index 01cd0c4..8f797a8 100755
--- a/extra/zabbix/vsphere-import/zabbix-vsphere-import
+++ b/extra/zabbix/vsphere-import/zabbix-vsphere-import
@@ -436,8 +436,14 @@ class ZabbixVSphere(object):
host
)
+ # Fix for issue #128
+ # Split the VM name which consists of '<vm> (uuid)'
+ # The host machine name ({HOST.HOST} macro) would become '<vm>'
+ # The host visible name ({HOST.NAME} macro) would become '<vm> (uuid)'
+ machine_name, visible_name = host.split(sep=' ')
params = deepcopy(host_options)
- params['host'] = host
+ params['host'] = machine_name
+ params['name'] = visible_name
# Add the virtual machine to it's respective hostgroup/cluster in Zabbix
# We do this by first finding the host this VM runs on and then we get the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment