Skip to content

Commit bec9223

Browse files
influx installation added
1 parent 16cd51c commit bec9223

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# background thread to monitor system settings changes
77
# print("FLASK_ENV: ", os.getenv('FLASK_ENV'))
88
# # if os.getenv('FLASK_ENV') == 'production':
9-
start_website_monitoring() # Starts pinging active websites
10-
fetch_file_metrics_task()
9+
# start_website_monitoring() # Starts pinging active websites
10+
# fetch_file_metrics_task()
1111
monitor_settings() # Starts monitoring for system logging changes
1212

1313
if __name__ == "__main__":

src/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
raise ValueError("Please set the INFLUXDB_TOKEN environment variable.")
4848
org = "systemguard"
4949
url = "http://localhost:8086"
50-
bucket="_monitoring"
50+
bucket="system_metrics"
5151
try:
5252
influx_client = InfluxDBClient(url=url, token=INFLUXDB_TOKEN, org=org)
53-
bucket = "_monitoring"
53+
bucket = "system_metrics"
5454
write_api = influx_client.write_api(write_options=SYNCHRONOUS)
5555
query_api = influx_client.query_api()
5656
logger.info("Connected to InfluxDB successfully")
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ CONTAINER_NAME="influxdb"
66
NETWORK_NAME="influx_network"
77
DATA_DIR="./influxdb_data"
88
INFLUXDB_USER="admin" # Change this to your desired username
9-
INFLUXDB_PASSWORD="admin_passwor" # Change this to your desired password
9+
INFLUXDB_PASSWORD="admin_password" # Change this to your desired password
1010
INFLUXDB_ORG="systemguard" # Change this to your desired organization name
1111
INFLUXDB_BUCKET="system_metrics" # Change this to your desired initial bucket (database) name
12-
INFLUXDB_TOKEN="GixPn4ZmYuPyzPtj2XivfALmtHUaatBTK85ZjSe78P8NdbM_J9426tTPoqnbQDCok_NgBreOaqzdmoGxJ3UfsA=="
12+
# demo influxdb token | change this to your own token
13+
INFLUXDB_TOKEN=""
1314

1415
# Export the INFLUXDB_TOKEN to be used later in your app
1516
export "INFLUXDB_TOKEN"=$INFLUXDB_TOKEN
@@ -45,6 +46,7 @@ echo "Running InfluxDB container..."
4546
docker run -d \
4647
--name $CONTAINER_NAME \
4748
--network $NETWORK_NAME \
49+
--restart=always \
4850
-p 8086:8086 \
4951
-v $PWD/$DATA_DIR:/var/lib/influxdb2 \
5052
-e DOCKER_INFLUXDB_INIT_MODE=setup \
@@ -55,5 +57,6 @@ docker run -d \
5557
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=$INFLUXDB_TOKEN \
5658
influxdb:$INFLUXDB_VERSION
5759

60+
5861
# Output completion message
5962
echo "InfluxDB setup completed! Access it at http://localhost:8086 with your credentials."

0 commit comments

Comments
 (0)