WIP: Try migration to hcl

This commit is contained in:
Ian Fijolek
2022-01-26 16:34:31 -08:00
parent 9ec62528d9
commit a0a6b8199a
14 changed files with 350 additions and 751 deletions
+29
View File
@@ -0,0 +1,29 @@
check_interval = "1s"
alert "log_command" {
command = ["echo", "regular", "'command!!!'", "{{.MonitorName}}"]
}
alert "log_shell" {
shell_command = "echo \"Failure on {{.MonitorName}} User is $USER\""
}
monitor "Command" {
command = ["echo", "$PATH"]
alert_down = ["log_command", "log_shell"]
alert_every = 2
check_interval = "10s"
}
monitor "Shell" {
shell_command = <<EOF
echo 'Some string with stuff';
echo 'another line';
echo $PATH;
exit 1
EOF
alert_down = ["log_command", "log_shell"]
alert_after = 5
alert_every = 0
check_interval = "1m"
}
+19
View File
@@ -0,0 +1,19 @@
check_interval = "1s"
monitor "Shell" {
shell_command = <<EOF
echo 'Some string with stuff';
echo "<angle brackets>";
exit 1
EOF
alert_down = ["log_shell"]
alert_after = 1
alert_every = 0
}
alert "log_shell" {
shell_command = <<EOF
echo 'Some string with stuff'
echo '<angle brackets>'
EOF
}
-18
View File
@@ -1,18 +0,0 @@
---
check_interval: 1
monitors:
- name: Shell
command: >
echo 'Some string with stuff';
echo "<angle brackets>";
exit 1
alert_down: ['log_shell']
alert_after: 1
alert_every: 0
alerts:
log_shell:
command: |
echo 'Some string with stuff'
echo '<angle brackets>'