Db/win pychecks merged#406
Conversation
…nto db/win_py_checks
…nto db/win_py_checks
masci
left a comment
There was a problem hiding this comment.
left few comments but it looks good
| PyChecksPath, | ||
| filepath.Join(GetDistPath(), "checks"), | ||
| config.Datadog.GetString("additional_checksd")) | ||
| //filepath.Join(_here, "lib"), |
There was a problem hiding this comment.
can we remove the commented lines?
| @@ -0,0 +1,344 @@ | |||
| # (C) Datadog, Inc. 2010-2016 | |||
There was a problem hiding this comment.
Why don't we use the check from integrations-core?
There was a problem hiding this comment.
Probably should be reviewed, outside the scope of this PR. I did the same thing we have in agent5, which is a module called wmi_check in agent/checks, and a slightly different module called wmi_check in agent/checks.d (via integrations-core)
There was a problem hiding this comment.
My bad, if we wipe this, we break a bunch of Windows check 😄
| defer gstate.unlock() | ||
|
|
||
| // call run function, it takes no args so we pass an empty tuple | ||
| log.Debugf("Running python check %s", c.ModuleName) |
There was a problem hiding this comment.
we might add the check ID here, otherwise if we have multiple instances there's no way to see which one is producing the log message
| // NOTICE: this will also setup the Python environment | ||
| coll := collector.NewCollector(GetDistPath(), filepath.Join(GetDistPath(), "checks"), | ||
| config.Datadog.GetString("additional_checksd"), PyChecksPath) | ||
| os.Setenv("PYTHONHOME", _here) |
There was a problem hiding this comment.
This breaks the agent on unix, since we set this environment variable in the agent shell script (see
If this is required on windows, could we only set it if the platform is windows or if PYTHONHOME is already set?
There was a problem hiding this comment.
that's actually a mistake; that's leftover from trial/error getting stuff to work. I'll remove it.
Agent6 can now load python checks, specifically the WMI check.