{"action":"created","issue":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/310","labels_url":"https://api.github.com/repos/balloob/home-assistant/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/310/comments","events_url":"https://api.github.com/repos/balloob/home-assistant/issues/310/events","html_url":"https://github.com/balloob/home-assistant/issues/310","id":104375182,"number":310,"title":"Feature Request : Sensor Monitoring for other systems on the network","user":{"login":"jldeen","id":7676214,"avatar_url":"https://avatars.githubusercontent.com/u/7676214?v=3","gravatar_id":"","url":"https://api.github.com/users/jldeen","html_url":"https://github.com/jldeen","followers_url":"https://api.github.com/users/jldeen/followers","following_url":"https://api.github.com/users/jldeen/following{/other_user}","gists_url":"https://api.github.com/users/jldeen/gists{/gist_id}","starred_url":"https://api.github.com/users/jldeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jldeen/subscriptions","organizations_url":"https://api.github.com/users/jldeen/orgs","repos_url":"https://api.github.com/users/jldeen/repos","events_url":"https://api.github.com/users/jldeen/events{/privacy}","received_events_url":"https://api.github.com/users/jldeen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balloob/home-assistant/labels/new_component_or_platform_request","name":"new_component_or_platform_request","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-01T23:39:56Z","updated_at":"2015-09-13T14:10:55Z","closed_at":null,"body":"Currently it seems the sensor component monitors the local system on which hass is installed, but I wonder if others would find it useful to check the same stats for other systems on the network via IP or DNS. \r\n\r\nI am a very new developer and probably won't be useful with coding for awhile, but I would love to help with documentation, testing, etc. for this project."},"comment":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/comments/139879835","html_url":"https://github.com/balloob/home-assistant/issues/310#issuecomment-139879835","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/310","id":139879835,"user":{"login":"fabaff","id":116184,"avatar_url":"https://avatars.githubusercontent.com/u/116184?v=3","gravatar_id":"","url":"https://api.github.com/users/fabaff","html_url":"https://github.com/fabaff","followers_url":"https://api.github.com/users/fabaff/followers","following_url":"https://api.github.com/users/fabaff/following{/other_user}","gists_url":"https://api.github.com/users/fabaff/gists{/gist_id}","starred_url":"https://api.github.com/users/fabaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabaff/subscriptions","organizations_url":"https://api.github.com/users/fabaff/orgs","repos_url":"https://api.github.com/users/fabaff/repos","events_url":"https://api.github.com/users/fabaff/events{/privacy}","received_events_url":"https://api.github.com/users/fabaff/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T14:10:55Z","updated_at":"2015-09-13T14:10:55Z","body":"I submitted PR #356 which could help in getting stats from other systems. Well, this will need an external script to gather the data and would not be the most efficient way to do it but should work in a basic manner.\r\n\r\nIf you are exposing the needed data on the remote host through a REST API, then HA will be able to get those information. Ok, the generic rest sensor is still work in progress at the moment. \r\n\r\nJust a proof-of-concept of how to create a smartdevice...Using [Flask](http://flask.pocoo.org/) to create a [REST API](https://flask-restful.readthedocs.org/en/0.3.4/) and [psuti](https://pypi.python.org/pypi/psutil) to access the system utilization information.\r\n\r\n```python\r\nfrom psutil import cpu_percent\r\nfrom flask import Flask\r\nfrom flask_restful import Resource, Api\r\n\r\napp = Flask(__name__)\r\napi = Api(app)\r\n\r\nclass CpuLoad(Resource):\r\n    def get(self):\r\n        cpu = cpu_percent(interval=None)\r\n        return {'cpu': '{}'.format(cpu)}\r\n\r\napi.add_resource(CpuLoad, '/')\r\n\r\nif __name__ == '__main__':\r\n    app.run(debug=True)\r\n```\r\nIf this script is running, the CPU data should be available.\r\n\r\n```bash\r\n$ curl -X GET http://127.0.0.1:5000/\r\n{\r\n    \"cpu\": \"13.2\"\r\n}\r\n```\r\n"}}