mirror of
https://github.com/simon987/chan_feed.git
synced 2025-12-13 20:49:03 +00:00
Initial commit
This commit is contained in:
18
monitoring.py
Normal file
18
monitoring.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from influxdb import InfluxDBClient
|
||||
|
||||
client = InfluxDBClient("localhost", 8086, "root", "root", "chan_feed")
|
||||
|
||||
|
||||
def init():
|
||||
db_exists = False
|
||||
for db in client.get_list_database():
|
||||
if db["name"] == "chan_feed":
|
||||
db_exists = True
|
||||
break
|
||||
|
||||
if not db_exists:
|
||||
client.create_database("chan_feed")
|
||||
|
||||
|
||||
def log(event):
|
||||
client.write_points(event)
|
||||
Reference in New Issue
Block a user