diff --git a/.vscode/launch.json b/.vscode/launch.json index 96fe3b2..732ce52 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "debugpy", "request": "launch", "module": "hbd.server.cli", - "args": ["-c", "/home/andreas/git/heartbeat/.hb.yaml", "-f", "-v", "-x"], + "args": ["-c", "~/.hb.yaml", "-f", "-v", "-x"], "cwd": "${workspaceFolder}", "env": { "PYTHONPATH": "${workspaceFolder}" @@ -32,7 +32,7 @@ "type": "debugpy", "request": "launch", "module": "debugpy", - "args": ["--listen", "5678", "--wait-for-client", "-m", "hbd.server.cli", "-c", ".hb.yaml", "-f", "-v"], + "args": ["--listen", "5678", "--wait-for-client", "-m", "hbd.server.cli", "-c", "~/.hb.yaml", "-f", "-v"], "env": { "PYTHONPATH": "${workspaceFolder}" }, "console": "integratedTerminal", "justMyCode": false diff --git a/hbd/server/config.py b/hbd/server/config.py index 22f736a..53a57a4 100644 --- a/hbd/server/config.py +++ b/hbd/server/config.py @@ -69,6 +69,37 @@ SERVER_DEFAULTS = { "thresholds": {}, } +THRESHOLD_DEFAULTS = { + 'thresholds': { + 'cpu_monitor': { + 'cpu_percent': { + 'warning': 80.0, + 'critical': 90.0 + } + }, + 'memory_monitor': { + 'percent': { + 'warning': 85.0, + 'critical': 95.0 + } + }, + 'disk_monitor': { + 'partitions': { + '/': { + 'percent': { + 'warning': 85.0, + 'critical': 90.0 + } + } + } + }, + 'rtt': { + 'warning': 200, + 'critical': 250.0 + } + } + } + def load_config(path=None): """Load configuration from a YAML file and merge with server defaults. diff --git a/hbd/server/templates/settings.html b/hbd/server/templates/settings.html index 127cad5..da9839e 100644 --- a/hbd/server/templates/settings.html +++ b/hbd/server/templates/settings.html @@ -3,6 +3,10 @@ {% include 'head.html' %}