summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2008-09-06 21:44:47 +0000
committerSeth Mos <seth.mos@xs4all.nl>2008-09-06 21:44:47 +0000
commit2cab9166198ad2b15831f0b5e74b8160a1d2286c (patch)
tree0a384b36156cf0665a1c21039aff40fcc00b8dd1 /usr/local/sbin
parent62eee255b48419088e4c4bbdbb1e7c2b71f486c8 (diff)
downloadpfsense-2cab9166198ad2b15831f0b5e74b8160a1d2286c.zip
pfsense-2cab9166198ad2b15831f0b5e74b8160a1d2286c.tar.gz
Modify the reset_slbd.sh script a bit. Needs test.
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/reset_slbd.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr/local/sbin/reset_slbd.sh b/usr/local/sbin/reset_slbd.sh
index 72ad638..c9399f7 100755
--- a/usr/local/sbin/reset_slbd.sh
+++ b/usr/local/sbin/reset_slbd.sh
@@ -1,12 +1,18 @@
#!/bin/sh
+FAILURE=0
+
for items in `ps auxcwwl | awk '/slbd/{print $3}'|awk -F"." '{print $1}'`
do
- if [ "$items" -gt "86" ]; then
- killall slbd
- sleep 2
- killall -9 slbd
- echo "Resetting slbd due to high cpu usage: ${items}%" | logger
- /usr/local/sbin/slbd -c/var/etc/slbd.conf -r5000
+ if [ "$items" -ge "20" ]; then
+ FAILURE=`expr $FAILURE + 1`
fi
done
+
+if [ "$FAILURE" -ge "1" ]; then
+ killall -9 slbd
+ sleep 2
+ echo "Resetting slbd due to high cpu usage: ${items}%" | logger
+ /usr/local/sbin/slbd -c/var/etc/slbd.conf -r5000
+ FAILURE=0
+fi
OpenPOWER on IntegriCloud