Skip to content

Instantly share code, notes, and snippets.

@higebu
Last active August 29, 2015 14:24
Show Gist options
  • Save higebu/718167e1813489d9fe3c to your computer and use it in GitHub Desktop.
Save higebu/718167e1813489d9fe3c to your computer and use it in GitHub Desktop.
Add {#DATACENTER.NAME} to zabbix proxy
diff -uprN a/src/zabbix_server/poller/checks_simple_vmware.c b/src/zabbix_server/poller/checks_simple_vmware.c
--- a/src/zabbix_server/poller/checks_simple_vmware.c 2015-04-22 16:56:00.000000000 +0900
+++ b/src/zabbix_server/poller/checks_simple_vmware.c 2015-07-10 16:38:46.590815221 +0900
@@ -570,6 +570,7 @@ int check_vcenter_cluster_discovery(AGEN
zbx_json_addobject(&json_data, NULL);
zbx_json_addstring(&json_data, "{#CLUSTER.ID}", cluster->id, ZBX_JSON_TYPE_STRING);
zbx_json_addstring(&json_data, "{#CLUSTER.NAME}", cluster->name, ZBX_JSON_TYPE_STRING);
+ zbx_json_addstring(&json_data, "{#DATACENTER.NAME}", "{{ datacenter }}", ZBX_JSON_TYPE_STRING);
zbx_json_close(&json_data);
}
@@ -984,6 +985,7 @@ int check_vcenter_hv_discovery(AGENT_REQ
zbx_json_addstring(&json_data, "{#HV.NAME}", name, ZBX_JSON_TYPE_STRING);
zbx_json_addstring(&json_data, "{#CLUSTER.NAME}",
NULL != cluster ? cluster->name : "", ZBX_JSON_TYPE_STRING);
+ zbx_json_addstring(&json_data, "{#DATACENTER.NAME}", "{{ datacenter }}", ZBX_JSON_TYPE_STRING);
zbx_json_close(&json_data);
zbx_free(name);
@@ -1780,6 +1782,7 @@ int check_vcenter_vm_discovery(AGENT_REQ
zbx_json_addstring(&json_data, "{#HV.NAME}", hv_name, ZBX_JSON_TYPE_STRING);
zbx_json_addstring(&json_data, "{#CLUSTER.NAME}",
NULL != cluster ? cluster->name : "", ZBX_JSON_TYPE_STRING);
+ zbx_json_addstring(&json_data, "{#DATACENTER.NAME}", "{{ datacenter }}", ZBX_JSON_TYPE_STRING);
zbx_json_close(&json_data);
zbx_free(hv_name);
@higebu
Copy link
Author

higebu commented Jul 10, 2015

{{ datacenter }}のところを実際のデータセンター名に置き換えてパッチ当ててビルドする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment