I followed DMC snippet examples listed at url
Custom alerts code snippets. From those examples I wrote and have been trying to get the code below to run as a custom alert script job in Data management Console V3.1.7. This alerts purpose is to warn the instance home file system is running out of space.
However, no matter what I attempt DMC does not recognize "$" as well as other issues. Can anyone suggest modifications that would allow this bash code to run as a custom alert? Thanks for anyone's help working with DMC.
My Code attempted (AIX host system)typedef homspc=$(df -F %z ${HOME} | tail -n 1 | awk '{print $3}' | tr -d '%')
df ${HOME}
echo "${HOME} space Used is ${homspc} percent"
if [ ${homspc} -gt 90 ]; then
echo "${Home} space used critical"
returnValue=-2
elif [ ${homspc} -gt 80 ]; then
echo "${Home} space used warning"
returnValue=-1
else
echo "OK"
returnValue=0
fi
exit $returnValue
Sample from DMC web pagesfreemem=$(cat /proc/meminfo | grep SwapFree | cut -d ":" -f 2 | awk '{print $1}')
echo freemem is $freemem
if [ $freemem -le 1000000 ];
then
echo "critical"
returnValue=-2
elif [ $freemem -le 2000000 ];
then
echo "warning"
returnValue=-1
else
echo "OK"
returnValue=0 fi
exit $returnValue------------------------------
Bill Ferguson
------------------------------
#Db2