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