https://github.com/federicoceratto/nim-netdata-plugin
Helper to create native Netdata plugins using Nim
https://github.com/federicoceratto/nim-netdata-plugin
netdata nim nim-lang nim-language particulates-sensors
Last synced: 2 months ago
JSON representation
Helper to create native Netdata plugins using Nim
- Host: GitHub
- URL: https://github.com/federicoceratto/nim-netdata-plugin
- Owner: FedericoCeratto
- License: lgpl-3.0
- Created: 2017-10-07T13:51:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-07T13:55:57.000Z (over 7 years ago)
- Last Synced: 2025-01-25T18:52:02.490Z (3 months ago)
- Topics: netdata, nim, nim-lang, nim-language, particulates-sensors
- Language: Nim
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Netdata Plugin helper for Nim
Based on: https://github.com/firehol/netdata/wiki/External-Plugins
A plugin instance can create multiple charts. Each chart can have multiple
dimensions.Charts and dimensions need to be created in order and before sending datapoints.
Usage:
.. code-block:: nim
import netdata_plugin
var p = newNetdataPlugin("myplugin")
p.addChart("example", "random", "", "Random Numbers Stacked chart",
"% of random numbers")
p.addDimension("random1", "", ChartAlgorithm.percentage_of_absolute_row)
p.addDimension("random2", "", ChartAlgorithm.incremental)
p.addDimension("random3)
p.sendChartDP("example", "random", {
"random1": 1,
"random2": 2,
"random3": 3,
})Output:
.. code-block:: txt
CHART example.random '' 'Random Numbers Stacked chart' '% of random numbers'
DIMENSION random1 '' percentage-of-absolute-row 1 1
DIMENSION random2 '' incremental 1 1
DIMENSION random3 '' absolute 1 1
BEGIN example.random
SET random1 = 1
SET random2 = 2
SET random3 = 3
ENDThe examples/ directory contains a plugin for the SDS011 particulate sensor