From 1686917201c990851f813795d3f073a570fdec49 Mon Sep 17 00:00:00 2001 From: noodlemctwoodle <15075388+noodlemctwoodle@users.noreply.github.com> Date: Sun, 16 Jun 2019 14:08:36 +0100 Subject: [PATCH] Updated Netdata documentation (#9606) * Updated Netdata documentation * Added missing `sensor:` tag * Added further examples and rephrased wording * Fixed `JSON` display issue * Fixed issues raised by fabaff reverted `system_load` to `load` modified full example removed comments from example * :pencil2: Tweak * :pencil2: Tweak * :pencil2: Tweak --- source/_components/netdata.markdown | 53 ++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/source/_components/netdata.markdown b/source/_components/netdata.markdown index a1e9444d8a5..6246eb756f2 100644 --- a/source/_components/netdata.markdown +++ b/source/_components/netdata.markdown @@ -43,21 +43,45 @@ $ curl -X GET "http://[Netdata_Instance]:19999/api/v1/data?chart=[data_group]&po - `dimension_names`: Names shown in the frontend. - `dimension_ids`: Names to use for `element`. +Alternatively you can browse to the built in Netdata API in your browser `http://[Netdata_Instance]:19999/api/v1/allmetrics?format=json` and search for the `data_group` identified in the Netdata frontend. In the example JSON below the data group is "system.load". + +```json + "system.load": { + "name":"system.load", + "context":"system.load", + "units":"load", + "last_updated": 1558446920, + "dimensions": { + "load1": { + "name": "load1", + "value": 0.1250000 + }, + "load5": { + "name": "load5", + "value": 0.1290000 + }, + "load15": { + "name": "load15", + "value": 0.1430000 + } + } + }, +``` + +Once the `data_group` "system.load" and the `element` "load15" have been identified from the JSON it can be configured in your configuration.yaml like the example below. + ## {% linkable_title Configuration %} -To add this platform to your installation, add the following to your `configuration.yaml` file: +Add the following to your `configuration.yaml`. ```yaml # Example configuration.yaml entry sensor: - platform: netdata - resources: + resources: load: data_group: system.load element: load15 - cpu: - data_group: system.cpu - element: system ``` {% configuration %} @@ -105,3 +129,22 @@ resources: type: boolean default: false {% endconfiguration %} + +### {% linkable_title Full Example %} + +```yaml +# Example configuration.yaml entry +sensor: + - platform: netdata + host: '192.168.1.2' + port: '19999' + name: SomeHostName + resources: + system_load: + data_group: system.load + element: load15 + core0_freq: + data_group: 'cpu.cpufreq' + element: 'cpu0' + icon: mdi:chip +```