调整监控配置
This commit is contained in:
@@ -111,3 +111,6 @@ email_config:
|
|||||||
sender_password: "LTS9BhmX9XhS36QS"
|
sender_password: "LTS9BhmX9XhS36QS"
|
||||||
alert_recipient: "bovine_liu@163.com" # 警报邮件接收者
|
alert_recipient: "bovine_liu@163.com" # 警报邮件接收者
|
||||||
|
|
||||||
|
glances:
|
||||||
|
host: "192.168.2.170"
|
||||||
|
port: 61208
|
||||||
@@ -41,6 +41,8 @@ class Config(object):
|
|||||||
# DB config
|
# DB config
|
||||||
self.mariadb = yconfig.get("db_config", {})
|
self.mariadb = yconfig.get("db_config", {})
|
||||||
self.redis = yconfig.get("redis_config", {})
|
self.redis = yconfig.get("redis_config", {})
|
||||||
|
|
||||||
# Email config
|
# Email config
|
||||||
self.email = yconfig.get("email_config", {})
|
self.email = yconfig.get("email_config", {})
|
||||||
|
# glances 监控配置
|
||||||
|
self.glances = yconfig.get("glances", {})
|
||||||
|
|||||||
4
main.py
4
main.py
@@ -72,8 +72,8 @@ def main():
|
|||||||
# 初始化 Glances 监控
|
# 初始化 Glances 监控
|
||||||
monitor = GlancesMonitor(
|
monitor = GlancesMonitor(
|
||||||
email_sender=robot.email_sender,
|
email_sender=robot.email_sender,
|
||||||
host='192.168.2.170',
|
host=config.glances.get("host"),
|
||||||
port=61208,
|
port=config.glances.get("port"),
|
||||||
cpu_threshold=80.0,
|
cpu_threshold=80.0,
|
||||||
load_threshold=None, # 自动设为 CPU 核心数 * 2
|
load_threshold=None, # 自动设为 CPU 核心数 * 2
|
||||||
io_threshold=80.0,
|
io_threshold=80.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user