{"action":"opened","number":3799,"pull_request":{"url":"https://api.github.com/repos/firehol/netdata/pulls/3799","id":193694787,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjk0Nzg3","html_url":"https://github.com/firehol/netdata/pull/3799","diff_url":"https://github.com/firehol/netdata/pull/3799.diff","patch_url":"https://github.com/firehol/netdata/pull/3799.patch","issue_url":"https://api.github.com/repos/firehol/netdata/issues/3799","number":3799,"state":"open","locked":false,"title":"Add a python plugin for monitoring power supplies on Linux.","user":{"login":"Ferroin","id":905151,"node_id":"MDQ6VXNlcjkwNTE1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/905151?v=4","gravatar_id":"","url":"https://api.github.com/users/Ferroin","html_url":"https://github.com/Ferroin","followers_url":"https://api.github.com/users/Ferroin/followers","following_url":"https://api.github.com/users/Ferroin/following{/other_user}","gists_url":"https://api.github.com/users/Ferroin/gists{/gist_id}","starred_url":"https://api.github.com/users/Ferroin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ferroin/subscriptions","organizations_url":"https://api.github.com/users/Ferroin/orgs","repos_url":"https://api.github.com/users/Ferroin/repos","events_url":"https://api.github.com/users/Ferroin/events{/privacy}","received_events_url":"https://api.github.com/users/Ferroin/received_events","type":"User","site_admin":false},"body":"This allows tracking battery statistics on Linux systems, as well as other energy storage devices that utilize the kernel's power_supply class (although i don't think there are drivers for any other type of energy storage device in the mainline kernel using this class right now).\r\n\r\nThe primary purpose of this module is twofold:\r\n\r\n* To provide a way for battery powered IoT devices to easily alert about a low battery.\r\n* To provide a way for all battery powered devices to alert on some easy to monitor battery health conditions.\r\n\r\nIt provides up to four charts, one which provides the remaining capacity as a percentage, and three others which report info about charge (in amp-hours), energy (in watt-hours), and voltage, each providing info about the current values, and possibly minimal and maximal values that can be used for computing battery life.\r\n\r\nExact support provided by each individual device varies.  Almost all provide the percentage capacity, but beyond that they may or may not support any or all of the attributes needed for the other three charts (ACPI compliant systems for example support most of the charge related ones, and two of the voltage related values, but none of the energy related ones).\r\n\r\nData collection is done by scanning entries in /sys/class/power_supply. One job must be created for each power supply to be monitored, and there is no autodetection (though the config includes an example that should work to monitor the main battery on most laptops).\r\n\r\nThis would probably be better off written in C as part of the core, but I ran out of patience trying to implement it there after about 16 hours spent trying to get it working at a rudimentary level.  If someone wants to re-implement this in C and submit a PR for it, let me know and I'll be happy to close this one and help with testing.\r\n\r\nTested on a ACPI compliant laptop.  I unfortunately don't have any other battery powered systems with more exotic hardware I can test this on, though it should Just Work (TM) for anything that uses the power_supply class (except AC power).\r\n\r\nP.S. I think i finally managed to put on together without forgetting any files...","created_at":"2018-06-08T18:48:52Z","updated_at":"2018-06-08T18:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/firehol/netdata/pulls/3799/commits","review_comments_url":"https://api.github.com/repos/firehol/netdata/pulls/3799/comments","review_comment_url":"https://api.github.com/repos/firehol/netdata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firehol/netdata/issues/3799/comments","statuses_url":"https://api.github.com/repos/firehol/netdata/statuses/124c9d45c7a4abbaab835a82534d8e1ca6d9ad79","head":{"label":"Ferroin:linux-psu-plugin","ref":"linux-psu-plugin","sha":"124c9d45c7a4abbaab835a82534d8e1ca6d9ad79","user":{"login":"Ferroin","id":905151,"node_id":"MDQ6VXNlcjkwNTE1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/905151?v=4","gravatar_id":"","url":"https://api.github.com/users/Ferroin","html_url":"https://github.com/Ferroin","followers_url":"https://api.github.com/users/Ferroin/followers","following_url":"https://api.github.com/users/Ferroin/following{/other_user}","gists_url":"https://api.github.com/users/Ferroin/gists{/gist_id}","starred_url":"https://api.github.com/users/Ferroin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ferroin/subscriptions","organizations_url":"https://api.github.com/users/Ferroin/orgs","repos_url":"https://api.github.com/users/Ferroin/repos","events_url":"https://api.github.com/users/Ferroin/events{/privacy}","received_events_url":"https://api.github.com/users/Ferroin/received_events","type":"User","site_admin":false},"repo":{"id":123435635,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM0MzU2MzU=","name":"netdata","full_name":"Ferroin/netdata","owner":{"login":"Ferroin","id":905151,"node_id":"MDQ6VXNlcjkwNTE1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/905151?v=4","gravatar_id":"","url":"https://api.github.com/users/Ferroin","html_url":"https://github.com/Ferroin","followers_url":"https://api.github.com/users/Ferroin/followers","following_url":"https://api.github.com/users/Ferroin/following{/other_user}","gists_url":"https://api.github.com/users/Ferroin/gists{/gist_id}","starred_url":"https://api.github.com/users/Ferroin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ferroin/subscriptions","organizations_url":"https://api.github.com/users/Ferroin/orgs","repos_url":"https://api.github.com/users/Ferroin/repos","events_url":"https://api.github.com/users/Ferroin/events{/privacy}","received_events_url":"https://api.github.com/users/Ferroin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ferroin/netdata","description":"Get control of your servers. Simple. Effective. Awesome! https://my-netdata.io/","fork":true,"url":"https://api.github.com/repos/Ferroin/netdata","forks_url":"https://api.github.com/repos/Ferroin/netdata/forks","keys_url":"https://api.github.com/repos/Ferroin/netdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ferroin/netdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ferroin/netdata/teams","hooks_url":"https://api.github.com/repos/Ferroin/netdata/hooks","issue_events_url":"https://api.github.com/repos/Ferroin/netdata/issues/events{/number}","events_url":"https://api.github.com/repos/Ferroin/netdata/events","assignees_url":"https://api.github.com/repos/Ferroin/netdata/assignees{/user}","branches_url":"https://api.github.com/repos/Ferroin/netdata/branches{/branch}","tags_url":"https://api.github.com/repos/Ferroin/netdata/tags","blobs_url":"https://api.github.com/repos/Ferroin/netdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ferroin/netdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ferroin/netdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ferroin/netdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ferroin/netdata/statuses/{sha}","languages_url":"https://api.github.com/repos/Ferroin/netdata/languages","stargazers_url":"https://api.github.com/repos/Ferroin/netdata/stargazers","contributors_url":"https://api.github.com/repos/Ferroin/netdata/contributors","subscribers_url":"https://api.github.com/repos/Ferroin/netdata/subscribers","subscription_url":"https://api.github.com/repos/Ferroin/netdata/subscription","commits_url":"https://api.github.com/repos/Ferroin/netdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ferroin/netdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ferroin/netdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ferroin/netdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ferroin/netdata/contents/{+path}","compare_url":"https://api.github.com/repos/Ferroin/netdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ferroin/netdata/merges","archive_url":"https://api.github.com/repos/Ferroin/netdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ferroin/netdata/downloads","issues_url":"https://api.github.com/repos/Ferroin/netdata/issues{/number}","pulls_url":"https://api.github.com/repos/Ferroin/netdata/pulls{/number}","milestones_url":"https://api.github.com/repos/Ferroin/netdata/milestones{/number}","notifications_url":"https://api.github.com/repos/Ferroin/netdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ferroin/netdata/labels{/name}","releases_url":"https://api.github.com/repos/Ferroin/netdata/releases{/id}","deployments_url":"https://api.github.com/repos/Ferroin/netdata/deployments","created_at":"2018-03-01T13:02:44Z","updated_at":"2018-06-01T18:51:46Z","pushed_at":"2018-06-08T18:42:15Z","git_url":"git://github.com/Ferroin/netdata.git","ssh_url":"git@github.com:Ferroin/netdata.git","clone_url":"https://github.com/Ferroin/netdata.git","svn_url":"https://github.com/Ferroin/netdata","homepage":"","size":24085,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"firehol:master","ref":"master","sha":"7da8ccfee649fb575f8d5acbcdcd6b42db2cf1b7","user":{"login":"firehol","id":9442231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NDIyMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/9442231?v=4","gravatar_id":"","url":"https://api.github.com/users/firehol","html_url":"https://github.com/firehol","followers_url":"https://api.github.com/users/firehol/followers","following_url":"https://api.github.com/users/firehol/following{/other_user}","gists_url":"https://api.github.com/users/firehol/gists{/gist_id}","starred_url":"https://api.github.com/users/firehol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firehol/subscriptions","organizations_url":"https://api.github.com/users/firehol/orgs","repos_url":"https://api.github.com/users/firehol/repos","events_url":"https://api.github.com/users/firehol/events{/privacy}","received_events_url":"https://api.github.com/users/firehol/received_events","type":"Organization","site_admin":false},"repo":{"id":10744183,"node_id":"MDEwOlJlcG9zaXRvcnkxMDc0NDE4Mw==","name":"netdata","full_name":"firehol/netdata","owner":{"login":"firehol","id":9442231,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NDIyMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/9442231?v=4","gravatar_id":"","url":"https://api.github.com/users/firehol","html_url":"https://github.com/firehol","followers_url":"https://api.github.com/users/firehol/followers","following_url":"https://api.github.com/users/firehol/following{/other_user}","gists_url":"https://api.github.com/users/firehol/gists{/gist_id}","starred_url":"https://api.github.com/users/firehol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firehol/subscriptions","organizations_url":"https://api.github.com/users/firehol/orgs","repos_url":"https://api.github.com/users/firehol/repos","events_url":"https://api.github.com/users/firehol/events{/privacy}","received_events_url":"https://api.github.com/users/firehol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firehol/netdata","description":"Get control of your servers. Simple. Effective. Awesome! https://my-netdata.io/","fork":false,"url":"https://api.github.com/repos/firehol/netdata","forks_url":"https://api.github.com/repos/firehol/netdata/forks","keys_url":"https://api.github.com/repos/firehol/netdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firehol/netdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firehol/netdata/teams","hooks_url":"https://api.github.com/repos/firehol/netdata/hooks","issue_events_url":"https://api.github.com/repos/firehol/netdata/issues/events{/number}","events_url":"https://api.github.com/repos/firehol/netdata/events","assignees_url":"https://api.github.com/repos/firehol/netdata/assignees{/user}","branches_url":"https://api.github.com/repos/firehol/netdata/branches{/branch}","tags_url":"https://api.github.com/repos/firehol/netdata/tags","blobs_url":"https://api.github.com/repos/firehol/netdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firehol/netdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firehol/netdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/firehol/netdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firehol/netdata/statuses/{sha}","languages_url":"https://api.github.com/repos/firehol/netdata/languages","stargazers_url":"https://api.github.com/repos/firehol/netdata/stargazers","contributors_url":"https://api.github.com/repos/firehol/netdata/contributors","subscribers_url":"https://api.github.com/repos/firehol/netdata/subscribers","subscription_url":"https://api.github.com/repos/firehol/netdata/subscription","commits_url":"https://api.github.com/repos/firehol/netdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/firehol/netdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/firehol/netdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/firehol/netdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/firehol/netdata/contents/{+path}","compare_url":"https://api.github.com/repos/firehol/netdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firehol/netdata/merges","archive_url":"https://api.github.com/repos/firehol/netdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firehol/netdata/downloads","issues_url":"https://api.github.com/repos/firehol/netdata/issues{/number}","pulls_url":"https://api.github.com/repos/firehol/netdata/pulls{/number}","milestones_url":"https://api.github.com/repos/firehol/netdata/milestones{/number}","notifications_url":"https://api.github.com/repos/firehol/netdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firehol/netdata/labels{/name}","releases_url":"https://api.github.com/repos/firehol/netdata/releases{/id}","deployments_url":"https://api.github.com/repos/firehol/netdata/deployments","created_at":"2013-06-17T18:39:10Z","updated_at":"2018-06-08T15:58:14Z","pushed_at":"2018-06-08T11:56:10Z","git_url":"git://github.com/firehol/netdata.git","ssh_url":"git@github.com:firehol/netdata.git","clone_url":"https://github.com/firehol/netdata.git","svn_url":"https://github.com/firehol/netdata","homepage":"","size":23808,"stargazers_count":29861,"watchers_count":29861,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2520,"mirror_url":null,"archived":false,"open_issues_count":471,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2520,"open_issues":471,"watchers":29861,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firehol/netdata/pulls/3799"},"html":{"href":"https://github.com/firehol/netdata/pull/3799"},"issue":{"href":"https://api.github.com/repos/firehol/netdata/issues/3799"},"comments":{"href":"https://api.github.com/repos/firehol/netdata/issues/3799/comments"},"review_comments":{"href":"https://api.github.com/repos/firehol/netdata/pulls/3799/comments"},"review_comment":{"href":"https://api.github.com/repos/firehol/netdata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firehol/netdata/pulls/3799/commits"},"statuses":{"href":"https://api.github.com/repos/firehol/netdata/statuses/124c9d45c7a4abbaab835a82534d8e1ca6d9ad79"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":316,"deletions":0,"changed_files":7}}
{"actor":{"display_login":"Ferroin"}}