Fixed typos and rearranged help a bit

This commit is contained in:
2024-08-23 16:37:46 -04:00
parent d178ceaa79
commit d776a8e239
2 changed files with 16 additions and 6 deletions
+12
View File
@@ -8,6 +8,7 @@ message=""
tag="exclamation"
priority="3"
state=""
testMode=""
case "$NAGIOS_NOTIFICATIONTYPE" in
PROBLEM) tag="bangbang";;
@@ -45,10 +46,21 @@ do_service() {
while [ -n "$1" ]; do
case "$1" in
-t|--type) alertType="$2"; shift 2;;
--test) testMode="true"; shift 1;;
*) shift 1;;
esac
done
if [ -n "$testMode" ]; then
NAGIOS_NOTIFICATIONTYPE="Test"
NAGIOS_HOSTNAME="FakeHost"
NAGIOS_HOSTSTATE="OK"
NAGIOS_SERVICEDESC="FakeService"
NAGIOS_HOSTALIAS="FakeHostAlias"
NAGIOS_SERVICESTATE="OK"
NAGIOS_LONGDATETIME="Today"
fi
case "$alertType" in
h|host|host) do_host;;
s|svc|service) do_service;;