Skip to content

Commit

Permalink
fix(inputs.vsphere): Use guest.guestId value if set for guest name (#…
Browse files Browse the repository at this point in the history
…14635)

(cherry picked from commit a0f239c)
  • Loading branch information
powersj committed Feb 20, 2024
1 parent 820c254 commit ef83bdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions plugins/inputs/vsphere/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,9 @@ func getVMs(ctx context.Context, e *Endpoint, resourceFilter *ResourceFilter) (o
// Sometimes Config is unknown and returns a nil pointer
if r.Config != nil {
guest = cleanGuestID(r.Config.GuestId)
if r.Guest.GuestId != "" {
guest = cleanGuestID(r.Guest.GuestId)
}
uuid = r.Config.Uuid
}
cvs := make(map[string]string)
Expand Down
3 changes: 2 additions & 1 deletion plugins/inputs/vsphere/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ func init() {
"HostSystem": {"parent", "summary.customValue", "customValue"},
"ResourcePool": {"parent", "customValue"},
"VirtualMachine": {"runtime.host", "config.guestId", "config.uuid", "runtime.powerState",
"summary.customValue", "guest.net", "guest.hostName", "resourcePool", "customValue"},
"summary.customValue", "guest.guestId", "guest.net", "guest.hostName", "resourcePool",
"customValue"},
"Datastore": {"parent", "info", "customValue"},
"ClusterComputeResource": {"parent", "customValue"},
"Datacenter": {"parent", "customValue"},
Expand Down

0 comments on commit ef83bdf

Please sign in to comment.