Skip to content

Fix: sync nfsclient ops map in nfsclient struct#9128

Merged
sspaink merged 1 commit intoinfluxdata:masterfrom
bearstech:hotfix/nfsclient
Apr 14, 2021
Merged

Fix: sync nfsclient ops map in nfsclient struct#9128
sspaink merged 1 commit intoinfluxdata:masterfrom
bearstech:hotfix/nfsclient

Conversation

@papey
Copy link
Copy Markdown
Contributor

@papey papey commented Apr 14, 2021

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #9127

Fixed an incorrect mapping inside the nfsclient plugin input.

In the Init function of the nfsclient plugin, nfs3Ops and nfs4Ops is prepared in a local map inside but never attached to the underlying nfsclient struct.

Passing an empty map to

		if (version == "3" && n.nfs3Ops[first]) || (version == "4" && n.nfs4Ops[first]) {
			tags["operation"] = first
			if len(nline) <= len(nfsopFields) {
				for i, t := range nline {
					fields[nfsopFields[i]] = t
				}
				acc.AddFields("nfs_ops", fields, tags)
			}
		}

Result in n.nfs3Ops[first] or n.nfs4Ops[first] to be false, and this branch of the code is never reached.

Copy link
Copy Markdown
Contributor

@telegraf-tiger telegraf-tiger bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Apr 14, 2021
@papey papey changed the title Fix: sync nfsclient ops map with nfsclient struct Fix: sync nfsclient ops map in nfsclient struct Apr 14, 2021
@papey
Copy link
Copy Markdown
Contributor Author

papey commented Apr 14, 2021

!signed-cla

Copy link
Copy Markdown
Contributor

@telegraf-tiger telegraf-tiger bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤝 ✅ CLA has been signed. Thank you!

Copy link
Copy Markdown
Contributor

@telegraf-tiger telegraf-tiger bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sspaink sspaink added fix pr to fix corresponding bug and removed feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Apr 14, 2021
@sspaink sspaink merged commit 1fa9259 into influxdata:master Apr 14, 2021
reimda pushed a commit that referenced this pull request Apr 28, 2021
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inputs.nfsclient unable to collect operations beyond read and write

3 participants