Skip to content

Commit a2b0278

Browse files
committed
print version if -debug is present
1 parent b2da326 commit a2b0278

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

vsphere-influxdb.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ func (vcenter *VCenter) Init(config Configuration) error {
150150

151151
client := vcenter.client
152152

153+
// Print version
154+
if debug {
155+
aboutInfo := client.Client.ServiceContent.About
156+
stdlog.Println("Version:", aboutInfo.FullName)
157+
}
158+
159+
153160
var perfmanager mo.PerformanceManager
154161
err := client.RetrieveOne(ctx, *client.ServiceContent.PerfManager, nil, &perfmanager)
155162
if err != nil {
@@ -753,7 +760,6 @@ func min(n ...int64) int64 {
753760
}
754761
return min
755762
}
756-
757763
func max(n ...int64) int64 {
758764
var max int64 = -1
759765
for _, i := range n {
@@ -804,7 +810,6 @@ func worker(id int, config Configuration, influxDBClient influxclient.Client, no
804810
results <- true
805811
continue
806812
}
807-
808813
if err := vcenter.Init(config); err == nil {
809814
vcenter.Query(config, influxDBClient, nowTime)
810815
}

0 commit comments

Comments
 (0)