]> arthur.barton.de Git - netdata.git/blob - python.d/example.chart.py
Comments, comments, comments.
[netdata.git] / python.d / example.chart.py
1 # Description: example netdata python.d plugin
2 # Author: Pawel Krupa (paulfantom)
3
4 import random
5 from base import BaseService
6
7 NAME = "example.chart.py"
8 # default module values
9 update_every = 3
10 priority = 90000
11 retries = 7
12
13
14 class Service(BaseService):
15     def __init__(self, configuration=None, name=None):
16         super(self.__class__,self).__init__(configuration=configuration)
17
18     def check(self):
19         return True
20     
21     def create(self):
22         print("CHART example.python_random '' 'A random number' 'random number' random random line " +
23               str(self.priority) +
24               " " +
25               str(self.update_every))
26         print("DIMENSION random1 '' absolute 1 1")
27         return True
28     
29     def update(self, interval):
30         print("BEGIN example.python_random "+str(interval))
31         print("SET random1 = "+str(random.randint(0,100)))
32         print("END")
33         return True