BugFix - check_reversetunnel
This commit is contained in:
parent
f5d76c488b
commit
ceb8d36ee2
@ -1,23 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
NAGIOS_OK = 0
|
NAGIOS_OK=0
|
||||||
NAGIOS_ERROR = 2
|
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)
|
AUTOSSH_PIDs=$(pidof autossh)
|
||||||
if [ -z $AUTOSSH_PIDs ]; then
|
if [ -z $AUTOSSH_PIDs ]; then
|
||||||
# no autossh process running
|
# no autossh process running
|
||||||
echo "No autossh process is running!"
|
echo "ERROR - No autossh process is running!"
|
||||||
exit $NAGIOS_ERROR
|
exit $NAGIOS_ERROR
|
||||||
else
|
else
|
||||||
# there is an autossh process
|
# 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
|
if [ $? -eq 0 ]; then
|
||||||
echo "The required autossh process is running"
|
echo "OK - The required autossh process is running"
|
||||||
exit $NAGIOS_OK
|
exit $NAGIOS_OK
|
||||||
else
|
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
|
exit $NAGIOS_ERROR
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user