summaryrefslogtreecommitdiff
path: root/exitcodes.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-04-17 19:47:08 +0300
committerPaul Buetow <paul@buetow.org>2023-04-17 19:47:08 +0300
commitf7456fded178b85637c82255e9c3178817f5fa68 (patch)
tree78d4a0e2d03793f3a1ce5ae6a14fa7684b59b598 /exitcodes.go
parente96f62acfd73d1c6b9a540927ada2ac8c81cffc1 (diff)
initial version
Diffstat (limited to 'exitcodes.go')
-rw-r--r--exitcodes.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/exitcodes.go b/exitcodes.go
new file mode 100644
index 0000000..18e3e19
--- /dev/null
+++ b/exitcodes.go
@@ -0,0 +1,21 @@
+package main
+
+const (
+ ok = 0
+ warning = 1
+ critical = 2
+ unknown = 3
+)
+
+func codeToString(state int) string {
+ switch state {
+ case 0:
+ return "OK"
+ case 1:
+ return "WARNING"
+ case 2:
+ return "CRITICAL"
+ default:
+ return "UNKNOWN"
+ }
+}