summaryrefslogtreecommitdiff
path: root/exitcodes.go
diff options
context:
space:
mode:
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"
+ }
+}