如何自定义特定主机告警值及配置

  • 下载hostWarnDiy.json
  • 将hostWarnDiy.json存到/server/config/下,仿照修改里面的配置项即可,里面配置项和/server/application.yml告警配置项一致,可以只填写个性化配置项,不用全部填写
  • hostWarnDiy.json和/server/application.yml的配置项目优先级比较,前者高于后者,即最终使用值为hostWarnDiy.json中配置项值。
    如果是告警开关的话,比如两个文件都有"memWarnMail"配置项,那么当application.yml中的值为yes时候,才会继续使用hostWarnDiy.json中的配置项值
    如果hostWarnDiy.json中的配置项值为no,则不会触发告警,yes才会触发告警。
    如果application.yml有"memWarnMail"配置项,而hostWarnDiy.json中没有这个配置,那么以application.yml中的配置项值为准
    如果是告警阈值,如果hostWarnDiy.json中有阈值,最终以hostWarnDiy.json中的阈值为准
  • 修改完成后,重启server
  • hostWarnDiy.json是在公共application.yml告警配置基础上,进行主机自定义配置,因此application.yml中告警开关开启后,才会执行hostWarnDiy.json格式如下:

[
	{
		"hostname":"127.0.0.1",
		"upSpeedMail":"yes",
		"upSpeedVal":10240,
		"downSpeedMail":"yes",
		"downSpeedVal":10240,
		"memWarnMail":"yes",
		"memWarnVal":99,
		"cpuWarnMail":"yes",
		"cpuWarnVal":99,
		"cpuTemperatureWarnMail":"no",
		"cpuTemperatureWarnVal":92,
		"diskWarnVal":99,
		"diskBlock":"",
		"diskWarnMail":"yes"
	},
	{
		"hostname":"127.0.0.2",
		"upSpeedMail":"yes",
		"upSpeedVal":10240,
		"downSpeedMail":"yes",
		"downSpeedVal":10240,
		"memWarnMail":"yes",
		"memWarnVal":99,
		"cpuWarnMail":"yes",
		"cpuWarnVal":99,
		"cpuTemperatureWarnMail":"no",
		"cpuTemperatureWarnVal":92,
		"diskWarnVal":99,
		"diskBlock":"",
		"diskWarnMail":"yes"
	}
]