{"action":"created","comment":{"url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/comments/37592221","id":37592221,"diff_hunk":"@@ -15,62 +15,84 @@ limitations under the License.\n --]]\n local HostInfo = require('./base').HostInfo\n \n-local table = require('table')\n-local execFileToBuffers = require('./misc').execFileToBuffers\n-local los = require('los')\n-local sigar = require('sigar')\n-local fmt = require('string').format\n+local misc = require('./misc')\n+local run = misc.run\n+local getInfoByVendor = misc.getInfoByVendor\n+local Transform = require('stream').Transform\n \n+--------------------------------------------------------------------------------------------------------------------\n+local Reader = Transform:extend()\n+\n+function Reader:initialize()\n+  Transform.initialize(self, {objectMode = true})\n+end\n+\n+function Reader:_transform(line, cb)\n+  local cvestart, _ = line:find('CVE-')\n+  local cvestr = line:sub(cvestart, cvestart+12)\n+  -- we want unique cves only\n+  self:push(cvestr)\n+  cb()\n+end\n+--------------------------------------------------------------------------------------------------------------------\n --[[ Check CVE fixes ]]--\n local Info = HostInfo:extend()\n+\n function Info:initialize()\n   HostInfo.initialize(self)\n end\n \n function Info:_run(callback)\n-  if los.type() ~= 'linux' then\n-    self._error = 'Unsupported OS for pluggable auth module definitions'\n-    return callback()\n-  end\n+  local errTable, outTable = {}, {}\n+  local deb, rhel\n+  deb = {cmd = '/bin/sh', args = {'-c',  'zcat /usr/share/doc/*/changelog.Debian.gz | grep CVE-'} }","path":"hostinfo/cve.lua","position":43,"original_position":43,"commit_id":"db2b8a75d91c874b3135b01f24278ea8690f5ed6","original_commit_id":"db2b8a75d91c874b3135b01f24278ea8690f5ed6","user":{"login":"rphillips","id":1963,"avatar_url":"https://avatars.githubusercontent.com/u/1963?v=3","gravatar_id":"","url":"https://api.github.com/users/rphillips","html_url":"https://github.com/rphillips","followers_url":"https://api.github.com/users/rphillips/followers","following_url":"https://api.github.com/users/rphillips/following{/other_user}","gists_url":"https://api.github.com/users/rphillips/gists{/gist_id}","starred_url":"https://api.github.com/users/rphillips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rphillips/subscriptions","organizations_url":"https://api.github.com/users/rphillips/orgs","repos_url":"https://api.github.com/users/rphillips/repos","events_url":"https://api.github.com/users/rphillips/events{/privacy}","received_events_url":"https://api.github.com/users/rphillips/received_events","type":"User","site_admin":false},"body":"local deb = ...\r\nlocal rhel = ...","created_at":"2015-08-20T23:19:32Z","updated_at":"2015-08-20T23:19:32Z","html_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838#discussion_r37592221","pull_request_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838","_links":{"self":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/comments/37592221"},"html":{"href":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838#discussion_r37592221"},"pull_request":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838"}}},"pull_request":{"url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838","id":42479210,"html_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838","diff_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838.diff","patch_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838.patch","issue_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/838","number":838,"state":"open","locked":false,"title":"kaustavha/Refactor/hostinfo","user":{"login":"kaustavha","id":3248143,"avatar_url":"https://avatars.githubusercontent.com/u/3248143?v=3","gravatar_id":"","url":"https://api.github.com/users/kaustavha","html_url":"https://github.com/kaustavha","followers_url":"https://api.github.com/users/kaustavha/followers","following_url":"https://api.github.com/users/kaustavha/following{/other_user}","gists_url":"https://api.github.com/users/kaustavha/gists{/gist_id}","starred_url":"https://api.github.com/users/kaustavha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaustavha/subscriptions","organizations_url":"https://api.github.com/users/kaustavha/orgs","repos_url":"https://api.github.com/users/kaustavha/repos","events_url":"https://api.github.com/users/kaustavha/events{/privacy}","received_events_url":"https://api.github.com/users/kaustavha/received_events","type":"User","site_admin":false},"body":"Refactor hostinfo checks to increase readability, reduce footprint, increase testability and reliability.","created_at":"2015-08-14T17:37:14Z","updated_at":"2015-08-20T23:19:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bccb8b70f868dfa1d75cb7620ff7a395c665bfd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838/commits","review_comments_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838/comments","review_comment_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/838/comments","statuses_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/statuses/db2b8a75d91c874b3135b01f24278ea8690f5ed6","head":{"label":"kaustavha:refactor/hostinfo3","ref":"refactor/hostinfo3","sha":"db2b8a75d91c874b3135b01f24278ea8690f5ed6","user":{"login":"kaustavha","id":3248143,"avatar_url":"https://avatars.githubusercontent.com/u/3248143?v=3","gravatar_id":"","url":"https://api.github.com/users/kaustavha","html_url":"https://github.com/kaustavha","followers_url":"https://api.github.com/users/kaustavha/followers","following_url":"https://api.github.com/users/kaustavha/following{/other_user}","gists_url":"https://api.github.com/users/kaustavha/gists{/gist_id}","starred_url":"https://api.github.com/users/kaustavha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaustavha/subscriptions","organizations_url":"https://api.github.com/users/kaustavha/orgs","repos_url":"https://api.github.com/users/kaustavha/repos","events_url":"https://api.github.com/users/kaustavha/events{/privacy}","received_events_url":"https://api.github.com/users/kaustavha/received_events","type":"User","site_admin":false},"repo":{"id":39226093,"name":"rackspace-monitoring-agent","full_name":"kaustavha/rackspace-monitoring-agent","owner":{"login":"kaustavha","id":3248143,"avatar_url":"https://avatars.githubusercontent.com/u/3248143?v=3","gravatar_id":"","url":"https://api.github.com/users/kaustavha","html_url":"https://github.com/kaustavha","followers_url":"https://api.github.com/users/kaustavha/followers","following_url":"https://api.github.com/users/kaustavha/following{/other_user}","gists_url":"https://api.github.com/users/kaustavha/gists{/gist_id}","starred_url":"https://api.github.com/users/kaustavha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaustavha/subscriptions","organizations_url":"https://api.github.com/users/kaustavha/orgs","repos_url":"https://api.github.com/users/kaustavha/repos","events_url":"https://api.github.com/users/kaustavha/events{/privacy}","received_events_url":"https://api.github.com/users/kaustavha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaustavha/rackspace-monitoring-agent","description":"Rackspace Cloud Monitoring Agent","fork":true,"url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent","forks_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/forks","keys_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/teams","hooks_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/hooks","issue_events_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/issues/events{/number}","events_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/events","assignees_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/assignees{/user}","branches_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/branches{/branch}","tags_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/tags","blobs_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/languages","stargazers_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/stargazers","contributors_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/contributors","subscribers_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/subscribers","subscription_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/subscription","commits_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/contents/{+path}","compare_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/merges","archive_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/downloads","issues_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/issues{/number}","pulls_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/labels{/name}","releases_url":"https://api.github.com/repos/kaustavha/rackspace-monitoring-agent/releases{/id}","created_at":"2015-07-16T23:57:27Z","updated_at":"2015-07-16T23:57:28Z","pushed_at":"2015-08-20T21:28:43Z","git_url":"git://github.com/kaustavha/rackspace-monitoring-agent.git","ssh_url":"git@github.com:kaustavha/rackspace-monitoring-agent.git","clone_url":"https://github.com/kaustavha/rackspace-monitoring-agent.git","svn_url":"https://github.com/kaustavha/rackspace-monitoring-agent","homepage":"http://virgoagent.com/rackspace-monitoring-agent/","size":18969,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"virgo-agent-toolkit:master","ref":"master","sha":"dba3d119350138deab92e0007fd6dd7684e70999","user":{"login":"virgo-agent-toolkit","id":6343547,"avatar_url":"https://avatars.githubusercontent.com/u/6343547?v=3","gravatar_id":"","url":"https://api.github.com/users/virgo-agent-toolkit","html_url":"https://github.com/virgo-agent-toolkit","followers_url":"https://api.github.com/users/virgo-agent-toolkit/followers","following_url":"https://api.github.com/users/virgo-agent-toolkit/following{/other_user}","gists_url":"https://api.github.com/users/virgo-agent-toolkit/gists{/gist_id}","starred_url":"https://api.github.com/users/virgo-agent-toolkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgo-agent-toolkit/subscriptions","organizations_url":"https://api.github.com/users/virgo-agent-toolkit/orgs","repos_url":"https://api.github.com/users/virgo-agent-toolkit/repos","events_url":"https://api.github.com/users/virgo-agent-toolkit/events{/privacy}","received_events_url":"https://api.github.com/users/virgo-agent-toolkit/received_events","type":"Organization","site_admin":false},"repo":{"id":2034526,"name":"rackspace-monitoring-agent","full_name":"virgo-agent-toolkit/rackspace-monitoring-agent","owner":{"login":"virgo-agent-toolkit","id":6343547,"avatar_url":"https://avatars.githubusercontent.com/u/6343547?v=3","gravatar_id":"","url":"https://api.github.com/users/virgo-agent-toolkit","html_url":"https://github.com/virgo-agent-toolkit","followers_url":"https://api.github.com/users/virgo-agent-toolkit/followers","following_url":"https://api.github.com/users/virgo-agent-toolkit/following{/other_user}","gists_url":"https://api.github.com/users/virgo-agent-toolkit/gists{/gist_id}","starred_url":"https://api.github.com/users/virgo-agent-toolkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virgo-agent-toolkit/subscriptions","organizations_url":"https://api.github.com/users/virgo-agent-toolkit/orgs","repos_url":"https://api.github.com/users/virgo-agent-toolkit/repos","events_url":"https://api.github.com/users/virgo-agent-toolkit/events{/privacy}","received_events_url":"https://api.github.com/users/virgo-agent-toolkit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent","description":"Rackspace Cloud Monitoring Agent","fork":false,"url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent","forks_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/forks","keys_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/teams","hooks_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/hooks","issue_events_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/events{/number}","events_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/events","assignees_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/assignees{/user}","branches_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/branches{/branch}","tags_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/tags","blobs_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/languages","stargazers_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/stargazers","contributors_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/contributors","subscribers_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/subscribers","subscription_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/subscription","commits_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/contents/{+path}","compare_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/merges","archive_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/downloads","issues_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues{/number}","pulls_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/labels{/name}","releases_url":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/releases{/id}","created_at":"2011-07-12T06:25:25Z","updated_at":"2015-08-03T10:32:22Z","pushed_at":"2015-08-20T19:59:33Z","git_url":"git://github.com/virgo-agent-toolkit/rackspace-monitoring-agent.git","ssh_url":"git@github.com:virgo-agent-toolkit/rackspace-monitoring-agent.git","clone_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent.git","svn_url":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent","homepage":"http://virgoagent.com/rackspace-monitoring-agent/","size":103610,"stargazers_count":114,"watchers_count":114,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":59,"forks":37,"open_issues":59,"watchers":114,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838"},"html":{"href":"https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/pull/838"},"issue":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/838"},"comments":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/issues/838/comments"},"review_comments":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838/comments"},"review_comment":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/pulls/838/commits"},"statuses":{"href":"https://api.github.com/repos/virgo-agent-toolkit/rackspace-monitoring-agent/statuses/db2b8a75d91c874b3135b01f24278ea8690f5ed6"}}}}