如何自定义某一个或多个主机的告警值及配置

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

[
	{
		"hostname":"127.0.0.1",
		"hostDownWarnMail":"yes",
		"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",
		"sysLoadWarnMail":"yes",
		"sysLoadWarnVal":10,
		"smartWarnMail":"yes"
	},
	{
		"hostname":"127.0.0.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":"",
		"diskWarnMail":"yes",
		"sysLoadWarnMail":"yes",
		"sysLoadWarnVal":30,
		"smartWarnMail":"no"
	}
]