Skip to content

Commit 3ddb5a3

Browse files
authored
patch to made RemoveHostDomainName optional
1 parent 3eb0f57 commit 3ddb5a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vsphere-influxdb.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type Configuration struct {
5151
Metrics []Metric
5252
Interval int
5353
Domain string
54+
RemoveHostDomainName bool
5455
InfluxDB InfluxDB
5556
}
5657

@@ -99,7 +100,7 @@ type EntityQuery struct {
99100
Metrics []int32
100101
}
101102

102-
var getversion, debug, test, RemoveHostDomainName bool
103+
var getversion, debug, test bool
103104
var stdlog, errlog *log.Logger
104105
var version = "master"
105106

@@ -445,7 +446,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
445446
hostSummary[host.Self] = make(map[string]string)
446447
hostSummary[host.Self]["name"] = hostSummary[host.Self]["name"] = host.Summary.Config.Name
447448
// Remove Domain Name from Host
448-
if RemoveHostDomainName {
449+
if config.RemoveHostDomainName {
449450
hostSummary[host.Self]["name"] = strings.Replace(host.Summary.Config.Name, config.Domain, "", -1)
450451
}
451452
hostSummary[host.Self]["cluster"] = hostToCluster[host.Self]

0 commit comments

Comments
 (0)