blob: ff0f22394862ac04cd0caf52f149e865b8b7b164 [file] [log] [blame]
koder aka kdanilovcff7b2e2015-04-18 20:48:15 +03001from .api import start_monitoring, Empty
koder aka kdanilove06762a2015-03-22 23:32:09 +02002# from influx_exporter import connect, add_data
koder aka kdanilovdda86d32015-03-16 11:20:04 +02003
4uri = "udp://192.168.0.104:12001"
koder aka kdanilove06762a2015-03-22 23:32:09 +02005# infldb_url = "influxdb://perf:perf@192.168.152.42:8086/perf"
6# conn = connect(infldb_url)
koder aka kdanilovdda86d32015-03-16 11:20:04 +02007
koder aka kdanilove06762a2015-03-22 23:32:09 +02008monitor_config = {'127.0.0.1':
9 {"block-io": {'allowed_prefixes': ['sda1', 'rbd1']},
10 "net-io": {"allowed_prefixes": ["virbr2"]}}}
koder aka kdanilovdda86d32015-03-16 11:20:04 +020011
12with start_monitoring(uri, monitor_config) as queue:
13 while True:
14 try:
15 (ip, port), data = queue.get(True, 1)
koder aka kdanilove06762a2015-03-22 23:32:09 +020016 print (ip, port), data
17 # add_data(conn, ip, [data])
koder aka kdanilovdda86d32015-03-16 11:20:04 +020018 except Empty:
19 pass