removed domain-specific info from scripts
This commit is contained in:
parent
f570318edc
commit
031a43c717
10
swapwatch.sh
10
swapwatch.sh
@ -3,8 +3,8 @@
|
|||||||
#2.0.0
|
#2.0.0
|
||||||
#rewrite by rlong
|
#rewrite by rlong
|
||||||
|
|
||||||
LOGDIR="/usr/local/lp/logs"
|
LOGDIR="/usr/local/sw/logs"
|
||||||
TMPFILE="/usr/local/lp/temp/swapwatch.results"
|
TMPFILE="/usr/local/sw/temp/swapwatch.results"
|
||||||
|
|
||||||
#Create and clear TMPFILE
|
#Create and clear TMPFILE
|
||||||
touch $TMPFILE
|
touch $TMPFILE
|
||||||
@ -33,7 +33,7 @@ else
|
|||||||
then
|
then
|
||||||
loadthreshold=5
|
loadthreshold=5
|
||||||
swapthreshold=524288
|
swapthreshold=524288
|
||||||
contact="support@liquidweb.com"
|
contact="support@DOMAIN.com"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check if we should run. either can trigger it
|
#check if we should run. either can trigger it
|
||||||
@ -69,7 +69,7 @@ else
|
|||||||
echo "" >> $TMPFILE
|
echo "" >> $TMPFILE
|
||||||
echo "Process List" >> $TMPFILE
|
echo "Process List" >> $TMPFILE
|
||||||
echo "" >> $TMPFILE
|
echo "" >> $TMPFILE
|
||||||
/bin/ps faux >> $TMPFILE 2>&1
|
/bin/ps faux >> $TMPFILE 2>&1
|
||||||
echo "" >> $TMPFILE
|
echo "" >> $TMPFILE
|
||||||
echo "" >> $TMPFILE
|
echo "" >> $TMPFILE
|
||||||
echo "Processes sorted by RESIDENT memory" >> $TMPFILE
|
echo "Processes sorted by RESIDENT memory" >> $TMPFILE
|
||||||
@ -80,7 +80,7 @@ else
|
|||||||
|
|
||||||
#Send the email to the $contact address
|
#Send the email to the $contact address
|
||||||
subject="[LW] Swapwatch.sh on $(hostname)"
|
subject="[LW] Swapwatch.sh on $(hostname)"
|
||||||
contents=$(cat $TMPFILE)
|
contents=$(cat $TMPFILE)
|
||||||
|
|
||||||
/usr/sbin/sendmail "$contact" <<EOF
|
/usr/sbin/sendmail "$contact" <<EOF
|
||||||
subject:$subject
|
subject:$subject
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
APPDIR="/usr/local/lp/apps/swapwatch"
|
APPDIR="/usr/local/sw/apps/swapwatch"
|
||||||
LOGDIR="/usr/local/lp/logs"
|
LOGDIR="/usr/local/sw/logs"
|
||||||
CONFDIR="/usr/local/lp/configs/swapwatch"
|
CONFDIR="/usr/local/sw/configs/swapwatch"
|
||||||
swapurl="http://layer3.liquidweb.com/monitoring/swapwatch.sh" #this will be appserv or nagilink
|
swapurl="http://DOMAIN.COM/swapwatch.sh" #this will be appserv or nagilink
|
||||||
updateurl="http://layer3.liquidweb.com/monitoring/swapupdate.sh" #this will be appserv or nagilink
|
updateurl="http://DOMAIN.com/swapupdate.sh" #this will be appserv or nagilink
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
@ -25,12 +25,12 @@ loadthresh=$( expr $cpus \* 5 )
|
|||||||
#memory is: 2G thresh for 7+, 1G for 2+, .5G for less than that
|
#memory is: 2G thresh for 7+, 1G for 2+, .5G for less than that
|
||||||
G=1048576 #your a gigabyte
|
G=1048576 #your a gigabyte
|
||||||
if [ $memory -gt $( expr 7 \* $G ) ]
|
if [ $memory -gt $( expr 7 \* $G ) ]
|
||||||
then
|
then
|
||||||
swapthresh=$( expr 2 \* $G )
|
swapthresh=$( expr 2 \* $G )
|
||||||
elif [ $memory -gt $( expr 2 \* $G ) ]
|
elif [ $memory -gt $( expr 2 \* $G ) ]
|
||||||
then
|
then
|
||||||
swapthresh=$G
|
swapthresh=$G
|
||||||
else
|
else
|
||||||
swapthresh=$( expr $G / 2 )
|
swapthresh=$( expr $G / 2 )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user