Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to monitor Windows hosts #6803

Merged
merged 1 commit into from Mar 27, 2017

Conversation

Projects
None yet
5 participants
@fabaff
Copy link
Member

commented Mar 26, 2017

Description:

Catch the exception of Windows hosts as they don't provide load details.

Related issue (if applicable): fixes #6482

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: glances
    host: IP_ADDRESS_WINDOWS_MACHINE
    resources:
    - 'processor_load'

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
@mention-bot

This comment has been minimized.

Copy link

commented Mar 26, 2017

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob to be a potential reviewer.

@pvizeli
Copy link
Member

left a comment

Is it not faster if we check the os instead trow a exeption ever x seconds for out stack?

@armills
Copy link
Contributor

left a comment

I think this implementation is preferable to checking the OS. Windows is one example but other OSes might behave the same, and other Windows versions could change behavior.

I think catching key errors is a pretty standard python practice. You could also branch with if 'load' in value:, but I'm not sure if there's a substantial difference.

@fabaff

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2017

As soon as I can get my hands on a Windows hosts I can probably provide a more robust solution.

@fabaff fabaff merged commit d027df5 into home-assistant:dev Mar 27, 2017

4 checks passed

cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.736%
Details
hound No violations found. Woof!

@fabaff fabaff deleted the fabaff:load-glances branch Mar 27, 2017

@fabaff fabaff referenced this pull request Apr 6, 2017

Merged

0.42 #6956

@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.