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