{"action":"created","issue":{"url":"https://api.github.com/repos/DataDog/dd-agent/issues/1096","labels_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1096/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1096/comments","events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1096/events","html_url":"https://github.com/DataDog/dd-agent/issues/1096","id":41302266,"number":1096,"title":"WMI issues ","user":{"login":"bunelr","id":3354626,"avatar_url":"https://avatars.githubusercontent.com/u/3354626?v=3","gravatar_id":"","url":"https://api.github.com/users/bunelr","html_url":"https://github.com/bunelr","followers_url":"https://api.github.com/users/bunelr/followers","following_url":"https://api.github.com/users/bunelr/following{/other_user}","gists_url":"https://api.github.com/users/bunelr/gists{/gist_id}","starred_url":"https://api.github.com/users/bunelr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunelr/subscriptions","organizations_url":"https://api.github.com/users/bunelr/orgs","repos_url":"https://api.github.com/users/bunelr/repos","events_url":"https://api.github.com/users/bunelr/events{/privacy}","received_events_url":"https://api.github.com/users/bunelr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DataDog/dd-agent/labels/windows","name":"windows","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/DataDog/dd-agent/milestones/16","html_url":"https://github.com/DataDog/dd-agent/milestones/Future","labels_url":"https://api.github.com/repos/DataDog/dd-agent/milestones/16/labels","id":198411,"number":16,"title":"Future","description":"<!---\r\n@huboard:{\"order\":0.0}\r\n-->\r\n","creator":{"login":"alq666","id":19755,"avatar_url":"https://avatars.githubusercontent.com/u/19755?v=3","gravatar_id":"","url":"https://api.github.com/users/alq666","html_url":"https://github.com/alq666","followers_url":"https://api.github.com/users/alq666/followers","following_url":"https://api.github.com/users/alq666/following{/other_user}","gists_url":"https://api.github.com/users/alq666/gists{/gist_id}","starred_url":"https://api.github.com/users/alq666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alq666/subscriptions","organizations_url":"https://api.github.com/users/alq666/orgs","repos_url":"https://api.github.com/users/alq666/repos","events_url":"https://api.github.com/users/alq666/events{/privacy}","received_events_url":"https://api.github.com/users/alq666/received_events","type":"User","site_admin":false},"open_issues":62,"closed_issues":56,"state":"open","created_at":"2012-10-19T19:54:23Z","updated_at":"2015-09-14T17:28:03Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-08-27T16:21:07Z","updated_at":"2015-09-14T17:28:03Z","closed_at":"2015-09-14T17:28:03Z","body":"From https://datadog.desk.com/agent/case/13780, using 5.0.0 on windows server 2008 r2\r\n\r\n````\r\nInitialization error: Traceback (most recent call last): \r\nFile \"config.pyc\", line 759, in load_check_directory \r\nFile \"C:\\Program Files (x86)\\Datadog\\Datadog Agent\\files\\..\\checks.d\\wmi_check.py\", line 12, in <module> \r\nFile \"wmi.pyc\", line 157, in <module> \r\nFile \"win32com\\client\\__init__.pyc\", line 72, in GetObject \r\nFile \"win32com\\client\\__init__.pyc\", line 87, in Moniker com_error: (-2147221020, 'Invalid syntax', None, None)\r\n````\r\n\r\nResearch of the error code lead me to this [documentation of wmi lib](http://timgolden.me.uk/python/wmi/cookbook.html#use-wmi-in-a-thread) : *This applies also if you’re running in a service, for example, which is implicitly threaded.* so we probably should run it after initializing it using `pythoncom.CoInitialize` but it worked well for now.\r\n\r\nAlso\r\n\r\nwhen using the datadog shell to execute the following code:\r\n\r\n````python\r\n> import pythoncom\r\n> pythoncom.CoInitialize()\r\n> import wmi\r\n> conn=wmi.WMI(None)\r\n> res = conn.Win32_PerfFormattedData_PerfDisk_PhysicalDisk()\r\n> print res[0]\r\n````\r\n\r\nreceive an error on the function `Win32_PerfFormattedData_PerfDisk_PhysicalDisk` not existing (attributeError) that couldn't be reproduced.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments/140152929","html_url":"https://github.com/DataDog/dd-agent/issues/1096#issuecomment-140152929","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1096","id":140152929,"user":{"login":"remh","id":1311477,"avatar_url":"https://avatars.githubusercontent.com/u/1311477?v=3","gravatar_id":"","url":"https://api.github.com/users/remh","html_url":"https://github.com/remh","followers_url":"https://api.github.com/users/remh/followers","following_url":"https://api.github.com/users/remh/following{/other_user}","gists_url":"https://api.github.com/users/remh/gists{/gist_id}","starred_url":"https://api.github.com/users/remh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remh/subscriptions","organizations_url":"https://api.github.com/users/remh/orgs","repos_url":"https://api.github.com/users/remh/repos","events_url":"https://api.github.com/users/remh/events{/privacy}","received_events_url":"https://api.github.com/users/remh/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T17:28:03Z","updated_at":"2015-09-14T17:28:03Z","body":"Not happening anymore."}}