-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ enabled = false | |
bot_token = "<tg bot token>" | ||
chat_id = "<chat id>" | ||
# host 可用字段参见 payload.rs 文件 HostStat 结构 | ||
online_tpl = "❗<b>Server Status</b>\n❗ {{ host.name }} 主机上线 🟢" | ||
offline_tpl = "❗<b>Server Status</b>\n❗ {{ host.name }} 主机下线 🔴" | ||
online_tpl = "❗<b>Server Status</b>\n❗ {{ host.location }} 地区的 {{ host.name }} 主机恢复上线 🟢" | ||
offline_tpl = "❗<b>Server Status</b>\n❗ {{ host.location }} 地区的 {{ host.name }} 主机已经下线 🔴" | ||
# 模板置空则停用自定义告警,只保留上下线通知 | ||
custom_tpl = """ | ||
{% if host.memory_used / host.memory_total > 0.5 %} | ||
|
@@ -41,8 +41,8 @@ enabled = false | |
corp_id = "<corp id>" | ||
corp_secret = "<corp secret>" | ||
agent_id = "<agent id>" | ||
online_tpl = "❗Server Status\n❗ {{ host.name }} 主机上线 🟢" | ||
offline_tpl = "❗Server Status\n❗ {{ host.name }} 主机下线 🔴" | ||
online_tpl = "❗Server Status\n❗ {{ host.location }} 地区的 {{ host.name }} 主机恢复上线 🟢" | ||
offline_tpl = "❗Server Status\n❗ {{ host.location }} 地区的 {{ host.name }} 主机已经下线 🔴" | ||
custom_tpl = """ | ||
{% if host.memory_used / host.memory_total > 0.8 %} | ||
❗{{ host.name }} 主机内存使用率超80% | ||
|
@@ -60,8 +60,8 @@ username = "[email protected]" | |
password = "***" | ||
to = "[email protected];[email protected]" | ||
subject = "ServerStatus Notification" | ||
online_tpl = "❗<b>Server Status</b><br/>❗ {{ host.name }} 主机上线 🟢" | ||
offline_tpl = "❗<b>Server Status</b><br/>❗ {{ host.name }} 主机下线 🔴" | ||
online_tpl = "❗<b>Server Status</b><br/>❗ {{ host.location }} 地区的 {{ host.name }} 主机恢复上线 🟢" | ||
offline_tpl = "❗<b>Server Status</b><br/>❗ {{ host.location }} 地区的 {{ host.name }} 主机已经下线 🔴" | ||
custom_tpl = """ | ||
{% if host.memory_used / host.memory_total > 0.8 %} | ||
<pre>❗{{ host.name }} 主机内存使用率超80%, 当前{{ (100 * host.memory_used / host.memory_total) | round }}% </pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters