Last active
August 29, 2015 14:21
-
-
Save dnaeon/eca835909b61b3a54427 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/extra/zabbix/vsphere-import/zabbix-vsphere-import b/extra/zabbix/vsphere-import/zabbix-vsphere-import | |
index 01cd0c4..3958e6a 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('(') | |
params = deepcopy(host_options) | |
- params['host'] = host | |
+ params['host'] = machine_name.strip() | |
+ params['name'] = host | |
# 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
It would be better if this mapped:
uuid => host.host
vm (uuid) => host.name
The zabbix host.host field must be unique. It's quite common for a vCloud environment to have a lot of VMs with the same name.