forked from zdz/ServerStatus-Rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.toml
49 lines (43 loc) · 1.58 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
http_addr = "0.0.0.0:8080"
tcp_addr = "0.0.0.0:34512"
# 默认30s无上报判断下线
offline_threshold = 30
# 使用vnstat来更精准统计月流量,开启参考下面 vnstat 一节
vnstat = false
# name 主机唯一标识,不可重复,alias 为展示名
# 批量部署时可以用主机 hostname 作为 name,统一密码
hosts = [
{name = "h1", password = "p1", alias = "n1", location = "🇨🇳", type = "kvm", monthstart = 1},
{name = "h2", password = "p2", alias = "n2", location = "🇺🇸", type = "kvm", monthstart = 1},
]
# 不开启告警,可省略后面配置
# 告警间隔 s
notify_interval = 30
# https://core.telegram.org/bots/api
# https://jinja.palletsprojects.com/en/3.0.x/templates/#if
[tgbot]
bot_token = "<tg bot token>"
chat_id = "<chat id>"
enabled = false
# host参见payload文件HostStat结构,模板置空则停用自定义告警
custom_tpl = """
{% if host.memory_used / host.memory_total > 0.5 %}
<pre>❗{{ host.name }} 主机内存使用率超50%, 当前{{ (100 * host.memory_used / host.memory_total) | round }}% </pre>
{% endif %}
{% if host.hdd_used / host.hdd_total > 0.5 %}
<pre>❗{{ host.name }} 主机硬盘使用率超50%, 当前{{ (100 * host.hdd_used / host.hdd_total) | round }}% </pre>
{% endif %}
"""
[wechat]
agent_id = "<agent id>"
corp_id = "<corp id>"
corp_secret = "<corp secret>"
custom_tpl = """
{% if host.memory_used / host.memory_total > 0.8 %}
❗{{ host.name }} 主机内存使用率超80%
{% endif %}
{% if host.hdd_used / host.hdd_total > 0.8 %}
❗{{ host.name }} 主机硬盘使用率超80%
{% endif %}
"""
enabled = false