Forum Discussion

Segman_342030's avatar
Segman_342030
Icon for Nimbostratus rankNimbostratus
May 17, 2018

External Monitoring - No successful responses received before deadline.

Hi,

We are using ssh in order to test if a process is running on the systems, When the process is running the test is ok, But when the process is not running, we are failing on time out, and getting "No successful responses received before deadline"

Any idea why?

Here is what we are using:

!/bin/sh

pidfile="/var/run/`basename ${0}`.$1..$2.pid"
if [ -f $pidfile ]
then
kill -9 -`cat $pidfile` > /dev/null 2>&1
fi
echo "$$" > $pidfile

 Remove the IPv6/IPv4 compatibility prefix
ip=`echo $1 | sed 's/::ffff://'`

 ssh root@$IP "ps -ef | grep [y]gwmanmx | grep -v grep 2>&1 >/tmp/result.mon"
sshpass -p 'password' ssh -o StrictHostKeyChecking=no root@$ip "ps -ef | grep [y]gwmanmx"
status=$?

if [ $status == 0 ]
then
rm -f $pidfile
echo "UP"
exit 0
fi
exit 0

Thank you

1 Reply

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Try:

    sshpass -p 'password' ssh -o StrictHostKeyChecking=no root@$ip "ps -ef | grep [y]gwmanmx"  > /dev/null 2>&1

    .