Update vsphere-influxdb.go
This commit is contained in:
parent
39330e4d31
commit
3eb0f579a9
|
@ -99,7 +99,7 @@ type EntityQuery struct {
|
||||||
Metrics []int32
|
Metrics []int32
|
||||||
}
|
}
|
||||||
|
|
||||||
var getversion, debug, test bool
|
var getversion, debug, test, RemoveHostDomainName bool
|
||||||
var stdlog, errlog *log.Logger
|
var stdlog, errlog *log.Logger
|
||||||
var version = "master"
|
var version = "master"
|
||||||
|
|
||||||
|
@ -443,7 +443,11 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
||||||
|
|
||||||
// Extra tags per host
|
// Extra tags per host
|
||||||
hostSummary[host.Self] = make(map[string]string)
|
hostSummary[host.Self] = make(map[string]string)
|
||||||
hostSummary[host.Self]["name"] = strings.Replace(host.Summary.Config.Name, config.Domain, "", -1)
|
hostSummary[host.Self]["name"] = hostSummary[host.Self]["name"] = host.Summary.Config.Name
|
||||||
|
// Remove Domain Name from Host
|
||||||
|
if RemoveHostDomainName {
|
||||||
|
hostSummary[host.Self]["name"] = strings.Replace(host.Summary.Config.Name, config.Domain, "", -1)
|
||||||
|
}
|
||||||
hostSummary[host.Self]["cluster"] = hostToCluster[host.Self]
|
hostSummary[host.Self]["cluster"] = hostToCluster[host.Self]
|
||||||
|
|
||||||
// Extra metrics per host
|
// Extra metrics per host
|
||||||
|
|
Loading…
Reference in New Issue