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

Netdata identifiers are not properly handled #14897

Closed
fabaff opened this issue Jun 9, 2018 · 6 comments
Closed

Netdata identifiers are not properly handled #14897

fabaff opened this issue Jun 9, 2018 · 6 comments
Assignees

Comments

@fabaff
Copy link
Member

fabaff commented Jun 9, 2018

Home Assistant release with the issue:
0.71

Operating environment (Hass.io/Docker/Windows/etc.):
all

Component/platform:
https://www.home-assistant.io/components/sensor.netdata/

Description of problem:

Multiple entries for the same resource will not work as they don't pass configuration validation.

    resources:
      cpu.cpufreq:
        element: cpu0
      cpu.cpufreq:
        element: cpu1

There are some deviation in the naming of values in the frontend and the RESTful API. In the documentation is stated that the frontend should be used to determine the name of the data_group. E.g., for hddtemp is the frontend using hddtemp_local.disks_temp and the API hddtemp_local.temperatures.

"hddtemp_local.temperatures":{  
   "name":"hddtemp_local.disks_temp",
   "context":"hddtemp.temperatures",
   "units":"Celsius",
   "last_updated":1528578157,
   "dimensions":{  
      "sda":{  
         "name":"sda",
         "value":45
      }
   }
},

This seems also be the case for network metrics. InOctets instead of received.

"system.ipv4":{  
   "name":"system.ipv4",
   "context":"system.ipv4",
   "units":"kilobits/s",
   "last_updated":1528578181,
   "dimensions":{  
      "InOctets":{  
         "name":"received",
         "value":2.4819415
      },
      "OutOctets":{  
         "name":"sent",
         "value":-2.4589827
      }
   }
},

It may happen at other places as well.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor:
  - platform: netdata
    resources:
      hddtemp_local.disks_temp:
        element: sda
 
sensor:
  - platform: netdata
    resources:
      system.ipv4:
        element: received

Additional information:
Initial report: https://community.home-assistant.io/t/netdata-configuration/55712

@fabaff
Copy link
Member Author

fabaff commented Jun 11, 2018

home-assistant/home-assistant.io#5528 contains details to get valid names for the elements to monitor.

@LarsNorgaard
Copy link

Is multiply element(s) supported?

sensors.acpitz-virtual-0_temperature:
    element: 
     - acpitz-virtual-0_temp1
     - acpitz-virtual-0_temp2

@Redferne
Copy link

Redferne commented Jul 1, 2018

    system.ram:
      element:
      - free
      - used
      - cached
      - buffers

2018-07-01 16:32:16 ERROR (MainThread) [homeassistant.components.sensor] netdata: Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 317, in async_device_update
    yield from self.async_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/netdata.py", line 134, in async_update
    resource_data['dimensions'][self._element]['value'], 2)
KeyError: "['free', 'used', 'cached', 'buffers']"

@fabaff
Copy link
Member Author

fabaff commented Jul 2, 2018

No support for multiple elements at the moment.

A PR would be welcome.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@fabaff
Copy link
Member Author

fabaff commented Sep 18, 2018

Was change with #16656.

@fabaff fabaff closed this as completed Sep 18, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants