I am checking the server-status in an apache server with a simple wget script which times out. My script supposedly returns a 1 or 0. The issue is that the agent times out and I do not get any return value. I increased the agent timeout to 27 seconds but I am not getting an answer back yet. I changed the trigger to check if it is not a 1 i.e. <> 1 but still the agent time out is killing me. How do I get around that? I need to get a value back.
here is my script:
/usr/bin/wget -t 1 --delete-after http://$1/server-status 2>&1 | grep "200 OK" > /dev/null
if [ $? -gt 0 ];then
echo 0
exit 1
else
echo 1
exit 0
fi
here is my script:
/usr/bin/wget -t 1 --delete-after http://$1/server-status 2>&1 | grep "200 OK" > /dev/null
if [ $? -gt 0 ];then
echo 0
exit 1
else
echo 1
exit 0
fi
Comment