#!/bin/bash
# Disk Space Monitoring for more than 96%
# Aand shuting down servers
# Declare Variebles
used_space=0
mount_point="/apps/"
threshold=$96%
DOMAIN_HOME=/apps/oracle/product/Middleware/user_projects/domains/cbs_idm_dom
EMAIL_ADDR=user@host
MW_BASE=/apps/oracle/product/Middleware
used_space=`df -k $mount_point | grep % | awk {'print $4'} | sed 's/%//g'`
#print "Free space available under \"$mount_point\" is `expr 100 - $used_space`%.\n"
if [ $used_space >= $threshold ]
echo $MESSAGE | mailx -s "Alert:Server disk is full - shutting down server." $EMAIL_ADDR
#sleep 60
then
#Shutdown OID in this host
# STOP
source $MW_BASE/wlserver_10.3/server/bin/setWLSEnv.sh
#STOP OPMN
#$MW_BASE/idm_inst/bin/opmnctl stopall > /apps/oracle/product/Middleware/scripts/logs/stop_idm_inst.log &
#$MW_BASE/idm_sync/bin/opmnctl stopall > /apps/oracle/product/Middleware/scripts/logs/stop_idm_sync.log &
#Stop Weblogic
$DOMAIN_HOME/bin/stopManagedWebLogic.sh wls_ods1 > /apps/oracle/product/Middleware/scripts/logs/stop_wls_ods2.log &
else
echo "INVALID OPTION"
fi;
|
|||||||||
closed as unclear what you're asking by dhag, vonbrand, chaos, mdpc, G-Man Oct 21 '15 at 22:30Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question. |
|||||||||
|
The cause of the error is this pair of lines
The first one sets threshold to something entirely unlike what I suspect you thing it's doing. Mainly because you haven't quoted the string, but partly because there's a
The
which spits out |
|||||||||
|