]> arthur.barton.de Git - nagcollect.git/commitdiff
Add wrapper script for calling test scripts as active service checks
authorAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:03:10 +0000 (12:03 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:06:09 +0000 (12:06 +0100)
This "wrapper script" consists of two parts, "top" and "bottom", which
must be executed before and after the passive service check script and
implement the regular Nagios check script conventions.

client/lib/wrapper/wrapper-bottom.sh [new file with mode: 0644]
client/lib/wrapper/wrapper-top.sh [new file with mode: 0644]

diff --git a/client/lib/wrapper/wrapper-bottom.sh b/client/lib/wrapper/wrapper-bottom.sh
new file mode 100644 (file)
index 0000000..1e91096
--- /dev/null
@@ -0,0 +1,12 @@
+
+# BEGIN: wrapper-bottom.sh
+
+if [ -z "$TEXT" -o -z "$STATUS" ]; then
+       echo "Test script !"
+       exit 3
+fi
+
+echo "$TEXT"
+exit "$STATUS"
+
+# -eof-
diff --git a/client/lib/wrapper/wrapper-top.sh b/client/lib/wrapper/wrapper-top.sh
new file mode 100644 (file)
index 0000000..a6040cd
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009-2011 Alexander Barton, alex@barton.de
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# Please read the file COPYING, README and AUTHORS for more information.
+#
+# Wrapper script for active service checks :-)
+#
+
+SERVICE=""; STATUS=""; TEXT=""
+
+# END: wrapper-top.sh
+