Forum Discussion
Mangretta
May 15, 2024Nimbostratus
monitor a pool that consists of Linux Squid Servers
I am trying to monitor a pool that consists of Linux Squid Servers. The issue I am having is when a squid servers service stops processing requests and the port 3128 is sgtill responding, the pool ...
Mangretta
May 15, 2024Nimbostratus
Ok. I have adjusted the code and have proven that I am indeed receiving a 0 back but the pool does not come up. Does anyone have any experience with this? I am using the F5 KB article mentioned with no success.
Here is the updated script and output.
# start sample script
#!/bin/sh
# (c) Copyright 1996-2007 F5 Networks, Inc.
#
# @(#) $Id: http_monitor_cURL+GET,v 1.0 2007/06/28 16:10:15 deb Exp $
# (based on sample_monitor,v 1.3 2005/02/04 18:47:17 saxon)
#
# these arguments supplied automatically for all external monitors:
# $1 = IP (IPv6 notation. IPv4 addresses are passed in the form
# ::ffff:w.x.y.z
# where "w.x.y.z" is the IPv4 address)
# $2 = port (decimal, host byte order)
#
# Additional command line arguments ($3 and higher) may be specified in the monitor template
# This example does not expect any additional command line arguments
#
# Name/Value pairs may also be specified in the monitor template
# This example expects the following Name/Vaule pairs:
# URI = the URI to request from the server
# RECV = the expected response (not case sensitive)
#
# remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
IP=`echo ${1} | sed 's/::ffff://'`
PORT=${2}
PIDFILE="/var/run/`basename ${0}`.${IP}_${PORT}.pid"
# kill of the last instance of this monitor if hung and log current pid
if [ -f $PIDFILE ]
then
echo "EAV exceeded runtime needed to kill ${IP}:${PORT}" | logger -p local0.error
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
# send request & check for expected response
website="https://mywebsite.com.com"
timeout_seconds=5
curl -x X.X.X.X:3128 --silent --output /dev/null --max-time $timeout_seconds $website
#if [ "$response_code" == "302" ];
if [ $? -eq 0 ]
then
rm -f $PIDFILE
echo "UP"
else
rm -f $PIDFILE
# echo "DOWN"
fi
exit
Output from F5 command line:
[admin@dc-pxy-rcp-f5a-inf-a1:Active:Changes Pending] / # curl -x X.X.X.X:3128 https://mywebsite.com
[admin@dc-pxy-rcp-f5a-inf-a1:Active:Changes Pending] / # echo $?
0
[admin@dc-pxy-rcp-f5a-inf-a1:Active:Changes Pending] / #
[admin@dc-pxy-rcp-f5a-inf-a1:Active:Changes Pending] / # echo $?
0
[admin@dc-pxy-rcp-f5a-inf-a1:Active:Changes Pending] / #
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects