1 # -*- coding: utf-8 -*-
2 # Description: example netdata python.d module
3 # Author: Pawel Krupa (paulfantom)
7 from base import SimpleService
9 NAME = os.path.basename(__file__).replace(".chart.py", "")
11 # default module values
17 class Service(SimpleService):
18 def __init__(self, configuration=None, name=None):
19 super(self.__class__,self).__init__(configuration=configuration, name=name)
25 self.chart("example.python_random", '', 'A random number', 'random number',
26 'random', 'random', 'line', self.priority, self.update_every)
27 self.dimension('random1')
31 def update(self, interval):
32 self.begin("example.python_random", interval)
33 self.set("random1", random.randint(0, 100))