summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--internal/state.go11
2 files changed, 13 insertions, 6 deletions
diff --git a/README.md b/README.md
index ce4a735..529039d 100644
--- a/README.md
+++ b/README.md
@@ -15,13 +15,13 @@ This is the recent Gogios report!
# Alerts with status changed:
-OK->CRITICAL: Check ICMP4 vulcan.buetow.org ==>> Check command timed out
-OK->CRITICAL: Check ICMP6 vulcan.buetow.org ==>> Check command timed out
+OK->CRITICAL: Check ICMP4 vulcan.buetow.org: Check command timed out
+OK->CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out
# Unhandled alerts:
-CRITICAL: Check ICMP4 vulcan.buetow.org ==>> Check command timed out
-CRITICAL: Check ICMP6 vulcan.buetow.org ==>> Check command timed out
+CRITICAL: Check ICMP4 vulcan.buetow.org: Check command timed out
+CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out
Have a nice day!
```
diff --git a/internal/state.go b/internal/state.go
index aaa54e9..3ac8e7d 100644
--- a/internal/state.go
+++ b/internal/state.go
@@ -92,16 +92,23 @@ func (s state) report(renotify bool) (string, string, bool) {
sb.WriteString("# Alerts with status changed:\n\n")
changed := s.reportChanged(&sb)
+ if !changed {
+ sb.WriteString("There were no status changes...\n\n")
+ }
sb.WriteString("# Unhandled alerts:\n\n")
numCriticals, numWarnings, numUnknown, numOK := s.reportUnhandled(&sb)
+ hasUnhandled := (numCriticals + numWarnings + numUnknown) > 0
+ if !hasUnhandled {
+ sb.WriteString("There are no unhandled alerts...\n\n")
+ }
sb.WriteString("Have a nice day!\n")
subject := fmt.Sprintf("GOGIOS Report [C:%d W:%d U:%d OK:%d]",
numCriticals, numWarnings, numUnknown, numOK)
- return subject, sb.String(), changed || (renotify && (numCriticals+numWarnings+numUnknown) > 0)
+ return subject, sb.String(), changed || (renotify && hasUnhandled)
}
func (s state) reportChanged(sb *strings.Builder) (changed bool) {
@@ -160,7 +167,7 @@ func (s state) reportBy(sb *strings.Builder, showStatusChange bool,
sb.WriteString(nagiosCode(cs.Status).Str())
sb.WriteString(": ")
sb.WriteString(name)
- sb.WriteString(" ==>> ")
+ sb.WriteString(": ")
sb.WriteString(cs.output)
sb.WriteString("\n")
}