|
@@ -1,23 +1,23 @@
|
1
|
1
|
#!/bin/sh
|
2
|
2
|
#
|
3
|
|
-NAGIOS_OK = 0
|
4
|
|
-NAGIOS_ERROR = 2
|
|
3
|
+NAGIOS_OK=0
|
|
4
|
+NAGIOS_ERROR=2
|
5
|
5
|
#
|
6
|
|
-MULTIMEDIA_TUNNEL_REGEX = "\-R 10022:localhost:22.*mount-mockery.de$"
|
|
6
|
+MULTIMEDIA_TUNNEL_REGEX="\-R 10022:localhost:22.*mount-mockery.de$"
|
7
|
7
|
#
|
8
|
8
|
AUTOSSH_PIDs=$(pidof autossh)
|
9
|
9
|
if [ -z $AUTOSSH_PIDs ]; then
|
10
|
10
|
# no autossh process running
|
11
|
|
- echo "No autossh process is running!"
|
|
11
|
+ echo "ERROR - No autossh process is running!"
|
12
|
12
|
exit $NAGIOS_ERROR
|
13
|
13
|
else
|
14
|
14
|
# there is an autossh process
|
15
|
|
- ps x -q $AUTOSSH_PIDs | grep $MULTIMEDIA_TUNNEL_REGEX 2>&1 > /dev/null
|
|
15
|
+ ps x -q $AUTOSSH_PIDs | grep "$MULTIMEDIA_TUNNEL_REGEX" 2>&1 > /dev/null
|
16
|
16
|
if [ $? -eq 0 ]; then
|
17
|
|
- echo "The required autossh process is running"
|
|
17
|
+ echo "OK - The required autossh process is running"
|
18
|
18
|
exit $NAGIOS_OK
|
19
|
19
|
else
|
20
|
|
- echo "There are autossh processes, but none of them fit to the required connection details"
|
|
20
|
+ echo "ERROR - There are autossh processes, but none of them fit to the required connection details"
|
21
|
21
|
exit $NAGIOS_ERROR
|
22
|
22
|
fi
|
23
|
23
|
fi
|