From 837c29f106ce6a65af90fe476624a3661e6493e1 Mon Sep 17 00:00:00 2001 From: Jo-stfc <71326101+Jo-stfc@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:20:32 +0000 Subject: [PATCH] healthcheck on close_wait states --- xrootd/xrootd-healthcheck.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xrootd/xrootd-healthcheck.sh b/xrootd/xrootd-healthcheck.sh index f8ce023..375e531 100644 --- a/xrootd/xrootd-healthcheck.sh +++ b/xrootd/xrootd-healthcheck.sh @@ -65,7 +65,12 @@ else exit 1 fi fi - - - +netstatus=`ss | awk '{print $2}' | sort | uniq -c | sort -n | grep 'CLOSE' | awk '{print $1}'` +if [[ -z "${netstatus}" ]]; then + echo "net ok" +else + if [[ $netstatus > 500 ]]; then + exit 1 + fi +fi exit 0