Update defaults and add tests for them

This commit is contained in:
Ian Fijolek
2025-12-11 16:06:01 -08:00
parent 85afa3d9ef
commit 5c97f2e5c4
7 changed files with 105 additions and 29 deletions
+6 -1
View File
@@ -1,6 +1,11 @@
check_interval = "1s"
default_alert_down = ["log_command"]
default_alert_after = 1
default_alert_every = 0
default_alert_after = 2
monitor "Default" {
command = ["echo"]
}
monitor "Command" {
command = ["echo", "$PATH"]
+5
View File
@@ -8,6 +8,11 @@ alert "log_shell" {
shell_command = "echo \"Failure on {{.MonitorName}} User is $USER\""
}
monitor "Default" {
command = ["echo"]
alert_down = ["log_command"]
}
monitor "Command" {
command = ["echo", "$PATH"]
alert_down = ["log_command", "log_shell"]
-25
View File
@@ -1,25 +0,0 @@
---
check_interval: 1s
monitors:
- name: Command
command: ["echo", "$PATH"]
alert_down: ["log_command", "log_shell"]
alert_every: 0
check_interval: 10s
- name: Shell
command: >
echo 'Some string with stuff';
echo 'another line';
echo $PATH;
exit 1
alert_down: ["log_command", "log_shell"]
alert_after: 5
alert_every: 0
check_interval: 1m
alerts:
log_command:
command: ["echo", "regular", '"command!!!"', "{{.MonitorName}}"]
log_shell:
command: echo "Failure on {{.MonitorName}} User is $USER"