Skip to content

Commit

Permalink
Update vsphere-influxdb.go
Browse files Browse the repository at this point in the history
  • Loading branch information
MicKBfr committed Apr 12, 2018
1 parent 39330e4 commit 3eb0f57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vsphere-influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type EntityQuery struct {
Metrics []int32
}

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

Expand Down Expand Up @@ -443,7 +443,11 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.

// Extra tags per host
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]

// Extra metrics per host
Expand Down

0 comments on commit 3eb0f57

Please sign in to comment.