加入日志
This commit is contained in:
@@ -6,7 +6,7 @@ import requests
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
class GlancesMonitor:
|
class GlancesMonitor:
|
||||||
def __init__(self, email_sender, host='localhost', port=61208,
|
def __init__(self, email_sender, host='127.0.0.1', port=61208,
|
||||||
cpu_threshold=80.0, load_threshold=None, io_threshold=80.0,
|
cpu_threshold=80.0, load_threshold=None, io_threshold=80.0,
|
||||||
disk_usage_threshold=60.0, handle_threshold=20000,
|
disk_usage_threshold=60.0, handle_threshold=20000,
|
||||||
recipient=None):
|
recipient=None):
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -72,7 +72,7 @@ def main():
|
|||||||
# 初始化 Glances 监控
|
# 初始化 Glances 监控
|
||||||
monitor = GlancesMonitor(
|
monitor = GlancesMonitor(
|
||||||
email_sender=robot.email_sender,
|
email_sender=robot.email_sender,
|
||||||
host='0.0.0.0',
|
host='127.0.0.1',
|
||||||
port=61208,
|
port=61208,
|
||||||
cpu_threshold=80.0,
|
cpu_threshold=80.0,
|
||||||
load_threshold=None, # 自动设为 CPU 核心数 * 2
|
load_threshold=None, # 自动设为 CPU 核心数 * 2
|
||||||
|
|||||||
Reference in New Issue
Block a user