Skip to content

Commit

Permalink
V1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wikm360 committed May 24, 2024
1 parent 8fec479 commit 148e86e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 66 deletions.
8 changes: 4 additions & 4 deletions base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from detail import path_log , path_user , path , token , chat_id , origin_path_log
from detail import path_log , path_user , path , token , chat_id , origin_path_log , cpu_threshold , ram_threshold
import os
import re
import json
Expand All @@ -9,8 +9,8 @@
import shutil
import psutil

CPU_THRESHOLD = 50
RAM_THRESHOLD = 50
CPU_THRESHOLD = cpu_threshold
RAM_THRESHOLD = ram_threshold

def get_cpu_usage():
return psutil.cpu_percent(interval=1) # Get CPU usage over 1 second interval
Expand Down Expand Up @@ -229,7 +229,7 @@ def clear_def() :

def main() :
#analize()
schedule.every().day.at("23:32" , timezone("Asia/Tehran")).do(copy_def)
schedule.every().day.at("12:00" , timezone("Asia/Tehran")).do(copy_def)
while True :
schedule.run_pending()
cpu_usage = get_cpu_usage()
Expand Down
10 changes: 6 additions & 4 deletions detail.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
path_log = "/home/wikmgg/Documents/GitHub/Xray-Log-Analyzer/access.log"
#/root/Xray-Log-Analyzer/access.log
#path_log = "/root/Xray-Log-Analyzer/access.log"
path_user = "/home/wikmgg/Documents/GitHub/Xray-Log-Analyzer/user/"
#/root/Xray-Log-Analyzer/user/
#path_user = "/root/Xray-Log-Analyzer/user/"
path = "/home/wikmgg/Documents/GitHub/Xray-Log-Analyzer/"
#/root/Xray-Log-Analyzer/
#path = "/root/Xray-Log-Analyzer/"
origin_path_log = "/var/lib/marzban/log/access.log"
chat_id = "877591460"
token = "6386634380:AAGdHDGK3hmoo5vh2IRj3w0Ntgb47XAoZhQ"
# token = '6386634380:AAGdHDGK3hmoo5vh2IRj3w0Ntgb47XAoZhQ'
# chat_id = '877591460'
# chat_id = '877591460'
cpu_threshold = 60
ram_threshold = 60
58 changes: 0 additions & 58 deletions scheduler.py

This file was deleted.

0 comments on commit 148e86e

Please sign in to comment.