我正在调整我的 bosun.conf 以允许我的os.cpu.high
警报在根据主机确定要使用的持续时间时使用查找:
lookup high_cpu {
entry host=* {
time = 5m
}
entry host=*graylog* {
time = 1h
}
}
alert os.cpu.high {
template = generic.graph
macro = host.based.contacts
$notes = Find CPU usage that is continually high
$duration = lookup("high_cpu", "time")
$host = *
$metric = "sum:rate{counter,,1}:os.cpu{host=$host}"
$q_cpu = q($metric, "$duration", "")
$q = avg($q_cpu)
warn = $q > 95
crit = $q > 99
ignoreUnknown = true
$q_format = %f
$unit_string = %
$generic_graph = $q_cpu
$graph_unit = %
}
这是我在测试时遇到的错误:
conf: Test Config:424:4: at <warn = $q > 95>: expr: unexpected "high" in func
我对 bosun 不是很熟悉,这可能很容易解决,但我无能为力。任何帮助,将不胜感激