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

[linux] make /proc configurable. #2482

Merged
merged 1 commit into from Jun 6, 2016
Merged

[linux] make /proc configurable. #2482

merged 1 commit into from Jun 6, 2016

Conversation

truthbk
Copy link
Member

@truthbk truthbk commented May 9, 2016

Allows overriding of /proc by defining procfs_path in datadog.conf - should be enforcable by using self.agentConfig.get("procfs_path") from any of the checks. I believe we enforce that pretty much everywhere relevant with this PR.

Places where we haven't overriden it just yet:

@hkaj hkaj self-assigned this May 27, 2016
output, _, _ = get_subprocess_output(['grep', 'model name', '/proc/cpuinfo'], log)
if not proc_path:
proc_path = "/proc"
proc_cpuinfo = "{}/cpuinfo".format(proc_path.rstrip('/'))
Copy link
Member

@hkaj hkaj May 30, 2016

Choose a reason for hiding this comment

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

Using os.path.join is usually more reliable for this kind of thing. You would also not have to worry about calling rstrip in a lot of places.

@hkaj
Copy link
Member

hkaj commented May 30, 2016

A few nits, and hopefully we can move some of the duplicated logic in the mother class.

I'm also wondering about these 2:

And the tests are failing on snmpd, I triggered it again in case it's flaky but if it doesn't pass you should have a look.

@olivielpeau olivielpeau added this to the 5.9.0 milestone May 31, 2016
@@ -15,6 +15,7 @@
from checks import AgentCheck
from checks.metric_types import MetricTypes
from config import _is_affirmative
from utils.platform import Platform
Copy link
Member

Choose a reason for hiding this comment

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

You need to remove this import, flake8 is failing on it as it's not used.

@hkaj
Copy link
Member

hkaj commented Jun 6, 2016

LGTM

[procfs] consistent naming with other checks that allow procfs path configuration.

[procfs] if set in agentconfig, override everywhere where psutil comes to play too.

[procfs] adding procfs_pathoption to example datadog.conf.

[procfs] use procfs_path where relevant.

[procfs] defer importing get_config to avoid circular dependency ImportError.
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.

None yet

3 participants