搜索看看
如何自定义某一个或多个主机的告警阈值和告警开关
一、v3.4.7或以上版本
只需要打开左侧菜单
自定义告警
模块,可以在此模块进行设置,配置后不用重启server即可生效
二、v3.4.6及之前的版本
这里主机的个性化告警配置,只支持:主机下线,上下行速率,磁盘空间,硬盘smart,系统负载,内存使用率,cpu使用率,cpu温度,登录信息提醒
1、下载
hostWarnDiy.json
。提示:这个工具可能会帮助到您,
JSON在线格式化工具
2、将hostWarnDiy.json保存到/server/config/下,仿照修改里面的配置项即可,里面配置项和/server/config/application.yml告警配置项一致,可以只填写个性化配置项,不用全部填写,多余的配置项(即和/server/config/application.yml一致的告警配置项)可以删除
3、hostWarnDiy.json和/server/config/application.yml的配置项目优先级比较,前者高于后者,即最终使用值为hostWarnDiy.json中配置项阈值进行告警
如果是告警开关的话,比如两个文件都有"memWarnMail"配置项,两个memWarnMail开关值都是yes时才会告警,有一个是no则不会告警
如果application.yml有"memWarnMail"配置项,而hostWarnDiy.json中没有"memWarnMail"配置项,那么以application.yml中的配置项值为准进行告警
如果是告警阈值,如果hostWarnDiy.json中有阈值,最终以hostWarnDiy.json中的阈值为准进行告警
4、修改完成后,重启server
5、hostWarnDiy.json是在公共application.yml告警配置基础上,进行主机自定义配置,因此application.yml中告警开关开启后,才会执行,hostWarnDiy.json格式如下:
[ { "hostname":"192.168.1.1", "hostDownWarnMail":"yes", "upSpeedMail":"yes", "upSpeedVal":10240, "upSpeedMinVal":0, "downSpeedMail":"yes", "downSpeedVal":10240, "downSpeedMinVal":0, "memWarnMail":"yes", "memWarnVal":99, "cpuWarnMail":"yes", "cpuWarnVal":99, "cpuTemperatureWarnMail":"no", "cpuTemperatureWarnVal":92, "diskWarnVal":99, "diskBlock":"'E:','F:'", "diskWarnMail":"yes", "sysLoadWarnMail":"yes", "sysLoadWarnVal":10, "hostLoginWarnMail":"yes", "smartWarnMail":"yes" }, { "hostname":"192.168.1.2", "hostDownWarnMail":"yes", "upSpeedMail":"yes", "upSpeedVal":20480, "downSpeedMail":"yes", "downSpeedVal":20480, "memWarnMail":"yes", "memWarnVal":80, "cpuWarnMail":"yes", "cpuWarnVal":200, "cpuTemperatureWarnMail":"yes", "cpuTemperatureWarnVal":90, "diskWarnVal":99, "diskBlock":"/snap/**", "diskWarnMail":"yes", "sysLoadWarnMail":"yes", "sysLoadWarnVal":30, "hostLoginWarnMail":"yes", "smartWarnMail":"no" } ]