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

Allows multiple Netdata elements per group #16656

Merged
merged 3 commits into from
Sep 18, 2018

Conversation

reefab
Copy link
Contributor

@reefab reefab commented Sep 17, 2018

Description:

Current Netdata component sensor configuration syntax only allows for one element per group.
This is an issue as this it is often needed to manage two different element at the same time, eg: download and upload for one network interface.

Related issue (if applicable): ref #14897 Called for a PR on that particular issue.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6296

Example entry for configuration.yaml (if applicable):

Current syntax:

sensor:
  - platform: netdata
    resources:
      snmp_router.bandwidth_eth0:
        element: in
        icon: mdi:download
        name: Download
       snmp_router.bandwidth_eth0:
         element: out
         icon: mdi:upload
         name: Upload

Doesn't work because of the duplicated snmp_router.bandwidth_eth0 key.

New syntax:

sensor:
  - platform: netdata
    host: 192.168.1.89
    resources:    
      Download:
        data_group: snmp_router.bandwidth_eth0
        element: in
        icon: mdi:download
      Upload:
        data_group: snmp_router.bandwidth_eth0
        element: out
        icon: mdi:upload

The previous name option is now mandatory and used as the key. As the name is used as part of the friendly name of the sensor, I'm not 100% sure if this is the right way to do it and I would like confirmation on that point.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

@fabaff
Copy link
Member

fabaff commented Sep 18, 2018

The previous name option is now mandatory and used as the key. As the name is used as part of the friendly name of the sensor, I'm not 100% sure if this is the right way to do it and I would like confirmation on that point.

The template platforms are using an identifier and have an additional friendly_name key. I think that we are fine by using it as a name.

@fabaff
Copy link
Member

fabaff commented Sep 18, 2018

Breaking change:
The netdata sensor platform now supports multiple values from the same data group. This requires you to update your existing configuration:

sensor:
  - platform: netdata
    host: 192.168.1.89
    resources:    
      Download:
        data_group: snmp_router.bandwidth_eth0
        element: in
        icon: mdi:download
      Upload:
        data_group: snmp_router.bandwidth_eth0
        element: out
        icon: mdi:upload

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🐦

@fabaff fabaff changed the title Netdata configuration change: Allows multiple elements per group Allows multiple Netdata elements per group Sep 18, 2018
@fabaff fabaff merged commit b7ef4dd into home-assistant:dev Sep 18, 2018
@ghost ghost removed the in progress label Sep 18, 2018
@balloob balloob mentioned this pull request Sep 28, 2018
@reefab reefab deleted the netdata_multiple_elements branch January 23, 2019 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants