triggers config added

This commit is contained in:
sqshq 2019-03-03 14:35:29 -05:00
parent 667d97a4b8
commit 031f8eefa6
2 changed files with 20 additions and 4 deletions

View File

@ -7,10 +7,9 @@ runcharts:
w: 53
h: 16
scale: 3
alerts:
- name: PROCESSING STARTED // ${prev} ${cur} ${lavel} // echo $(( 3 < 4 && 1 > 2 ))
trigger: ((${prev} == 0 && ${cur} > 0))
repeat: false
triggers:
- title: PROCESSING STARTED # ${prev} ${cur} ${lavel} echo $(( 3 < 4 && 1 > 2 ))
condition: ((${prev} == 0 && ${cur} > 0))
action:
terminal-bell: true
sound: false

View File

@ -13,8 +13,22 @@ type ComponentConfig struct {
Size Size `yaml:"size"`
}
type TriggerConfig struct {
Title string `yaml:"title"`
Condition string `yaml:"condition"`
Action *Action `yaml:"action,omitempty"`
}
type Action struct {
TerminalBell *bool `yaml:"terminal-bell,omitempty"`
Sound *bool `yaml:"sound,omitempty"`
Visual *bool `yaml:"visual,omitempty"`
Script *bool `yaml:"script,omitempty"`
}
type GaugeConfig struct {
ComponentConfig `yaml:",inline"`
TriggerConfig `yaml:",inline"`
Scale *int `yaml:"scale,omitempty"`
Color *ui.Color `yaml:"color,omitempty"`
Values map[string]string `yaml:"values"`
@ -23,18 +37,21 @@ type GaugeConfig struct {
type BarChartConfig struct {
ComponentConfig `yaml:",inline"`
TriggerConfig `yaml:",inline"`
Scale *int `yaml:"scale,omitempty"`
Items []data.Item `yaml:"items"`
}
type AsciiBoxConfig struct {
ComponentConfig `yaml:",inline"`
TriggerConfig `yaml:",inline"`
data.Item `yaml:",inline"`
Font *asciibox.AsciiFont `yaml:"font,omitempty"`
}
type RunChartConfig struct {
ComponentConfig `yaml:",inline"`
TriggerConfig `yaml:",inline"`
Legend *LegendConfig `yaml:"legend,omitempty"`
Scale *int `yaml:"scale,omitempty"`
Items []data.Item `yaml:"items"`