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