From f50b1e2494f218e5d2e41e81df9636bd02f5afe8 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 15 Nov 2011 12:03:10 +0100 Subject: [PATCH] Add wrapper script for calling test scripts as active service checks 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 | 12 ++++++++++++ client/lib/wrapper/wrapper-top.sh | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 client/lib/wrapper/wrapper-bottom.sh create mode 100644 client/lib/wrapper/wrapper-top.sh diff --git a/client/lib/wrapper/wrapper-bottom.sh b/client/lib/wrapper/wrapper-bottom.sh new file mode 100644 index 0000000..1e91096 --- /dev/null +++ b/client/lib/wrapper/wrapper-bottom.sh @@ -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 index 0000000..a6040cd --- /dev/null +++ b/client/lib/wrapper/wrapper-top.sh @@ -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 + -- 2.39.2