From ceb8d36ee25783321761b98b9e7828bf64294b90 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sat, 20 Jul 2024 19:02:08 +0200 Subject: [PATCH 1/2] BugFix - check_reversetunnel --- check_reversetunnel | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/check_reversetunnel b/check_reversetunnel index 0508113..7ce7b0a 100755 --- a/check_reversetunnel +++ b/check_reversetunnel @@ -1,23 +1,23 @@ #!/bin/sh # -NAGIOS_OK = 0 -NAGIOS_ERROR = 2 +NAGIOS_OK=0 +NAGIOS_ERROR=2 # -MULTIMEDIA_TUNNEL_REGEX = "\-R 10022:localhost:22.*mount-mockery.de$" +MULTIMEDIA_TUNNEL_REGEX="\-R 10022:localhost:22.*mount-mockery.de$" # AUTOSSH_PIDs=$(pidof autossh) if [ -z $AUTOSSH_PIDs ]; then # no autossh process running - echo "No autossh process is running!" + echo "ERROR - No autossh process is running!" exit $NAGIOS_ERROR else # there is an autossh process ps x -q $AUTOSSH_PIDs | grep $MULTIMEDIA_TUNNEL_REGEX 2>&1 > /dev/null if [ $? -eq 0 ]; then - echo "The required autossh process is running" + echo "OK - The required autossh process is running" exit $NAGIOS_OK else - echo "There are autossh processes, but none of them fit to the required connection details" + echo "ERROR - There are autossh processes, but none of them fit to the required connection details" exit $NAGIOS_ERROR fi fi From 230dd25be6a2c3412c514000fc19b64ae7ee88ef Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sat, 20 Jul 2024 19:07:03 +0200 Subject: [PATCH 2/2] BugFix - check_reversetunnel --- check_reversetunnel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_reversetunnel b/check_reversetunnel index 7ce7b0a..8123394 100755 --- a/check_reversetunnel +++ b/check_reversetunnel @@ -12,7 +12,7 @@ if [ -z $AUTOSSH_PIDs ]; then exit $NAGIOS_ERROR else # there is an autossh process - ps x -q $AUTOSSH_PIDs | grep $MULTIMEDIA_TUNNEL_REGEX 2>&1 > /dev/null + ps x -q $AUTOSSH_PIDs | grep "$MULTIMEDIA_TUNNEL_REGEX" 2>&1 > /dev/null if [ $? -eq 0 ]; then echo "OK - The required autossh process is running" exit $NAGIOS_OK