From: Alexander Barton Date: Tue, 15 Nov 2011 11:03:10 +0000 (+0100) Subject: Add wrapper script for calling test scripts as active service checks X-Git-Tag: rel-3~3^2~6 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git;a=commitdiff_plain;h=f50b1e2494f218e5d2e41e81df9636bd02f5afe8 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. --- 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 +