Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[disk] be resilient when dealing with NFS secure mounts #470

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

masci
Copy link
Contributor

@masci masci commented Jun 12, 2017

What does this PR do?

When dealing with secure NFS mounts, in the collector log you can see:

Unable to get disk metrics for /mypath (deleted): [Errno 2] No such file or directory: '/mypath (deleted)'

Since the string is composed like this, in the check:
self.log.warn("Unable to get disk metrics for %s: %s", part.mountpoint, e)
this means that (deleted) ​is part of the mountpoint name returned by psutils and this fools any attempt to exclude a filesystem.

This PR contains a hack to strip the unwanted part of the mountpoint string before evaluating the skip clauses, looking for feedback whether this is an acceptable workaround to the problem.

Versioning

  • Bumped the version check in manifest.json
  • Updated CHANGELOG.md

@masci masci added this to the triage milestone Jun 14, 2017
@masci masci modified the milestones: triage, 5.18 Oct 2, 2017
disk/check.py Outdated
self.log.debug('_exclude_disk: {}, {}, {}'.format(name, filesystem, mountpoint))

# temporary hack for NFS secure mounts
mountpoint = mountpoint.split()[0]
Copy link
Member

Choose a reason for hiding this comment

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

What if the mountpoint contains space ?

disk/check.py Outdated
# hack for NFS secure mounts
# secure mounts might look like this: '/mypath (deleted)'
# we should ignore all the bits not part of the mountpoint name
mountpoint = mountpoint.split()[-1]
Copy link
Member

Choose a reason for hiding this comment

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

This will return (deleted) if it's here. Shouldn't we do something like that:

mountpoint = mountpoint.rsplit(' ', 1)[0]

@masci masci force-pushed the massi/disk-nfs-secure branch from f668c48 to 0fed29c Compare October 2, 2017 17:13
@truthbk truthbk merged commit 60c928f into master Oct 4, 2017
@masci masci deleted the massi/disk-nfs-secure branch November 24, 2017 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants