Skip to content

Commit

Permalink
patch to made RemoveHostDomainName optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MicKBfr committed Apr 12, 2018
1 parent 3eb0f57 commit 3ddb5a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vsphere-influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type Configuration struct {
Metrics []Metric
Interval int
Domain string
RemoveHostDomainName bool
InfluxDB InfluxDB
}

Expand Down Expand Up @@ -99,7 +100,7 @@ type EntityQuery struct {
Metrics []int32
}

var getversion, debug, test, RemoveHostDomainName bool
var getversion, debug, test bool
var stdlog, errlog *log.Logger
var version = "master"

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

0 comments on commit 3ddb5a3

Please sign in to comment.