mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
patch to made RemoveHostDomainName optional
This commit is contained in:
parent
3eb0f579a9
commit
3ddb5a30da
@ -51,6 +51,7 @@ type Configuration struct {
|
|||||||
Metrics []Metric
|
Metrics []Metric
|
||||||
Interval int
|
Interval int
|
||||||
Domain string
|
Domain string
|
||||||
|
RemoveHostDomainName bool
|
||||||
InfluxDB InfluxDB
|
InfluxDB InfluxDB
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ type EntityQuery struct {
|
|||||||
Metrics []int32
|
Metrics []int32
|
||||||
}
|
}
|
||||||
|
|
||||||
var getversion, debug, test, RemoveHostDomainName bool
|
var getversion, debug, test bool
|
||||||
var stdlog, errlog *log.Logger
|
var stdlog, errlog *log.Logger
|
||||||
var version = "master"
|
var version = "master"
|
||||||
|
|
||||||
@ -445,7 +446,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
|||||||
hostSummary[host.Self] = make(map[string]string)
|
hostSummary[host.Self] = make(map[string]string)
|
||||||
hostSummary[host.Self]["name"] = hostSummary[host.Self]["name"] = host.Summary.Config.Name
|
hostSummary[host.Self]["name"] = hostSummary[host.Self]["name"] = host.Summary.Config.Name
|
||||||
// Remove Domain Name from Host
|
// 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]["name"] = strings.Replace(host.Summary.Config.Name, config.Domain, "", -1)
|
||||||
}
|
}
|
||||||
hostSummary[host.Self]["cluster"] = hostToCluster[host.Self]
|
hostSummary[host.Self]["cluster"] = hostToCluster[host.Self]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user