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
16 class Service(BaseService):
17 def __init__(self, configuration=None, name=None):
18 super(self.__class__,self).__init__(configuration=configuration, name=name)
24 print("CHART example.python_random '' 'A random number' 'random number' random random line " +
27 str(self.update_every))
28 print("DIMENSION random1 '' absolute 1 1")
31 def update(self, interval):
32 print("BEGIN example.python_random "+str(interval))
33 print("SET random1 = "+str(random.randint(0,100)))