Hi, I need help!
There is scrip of monitoring:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="thresholdEnabled">true</entry>
<entry key="executeFrom">1</entry>
<entry key="interval">1</entry>
<entry key="monitorName">Monitor replication cluster</entry>
<entry key="commandLine">sh ${FileName}.sh /tmp/monitoring/monitor_replication_cluster.log</entry>
<entry key="yaxisText">True(1)/False(0)</entry>
<entry key="clrMessage"></entry>
<entry key="version">2</entry>
<entry key="scriptBody">main ()
{
# To check the argument
[ $1 ] || { echo "Message: Missing log file"; exit 1; }
FILE_NAME=$1
DIR_NAME=`dirname ${FILE_NAME}`
WD=`pwd`
if [ ! -r ${DIR_NAME} ]
then
echo "Message: You do not have read permission in this directory '${DIR_NAME}'"
exit 1
elif [ -f ${FILE_NAME} ]
then
cat ${FILE_NAME}
else
echo "Message: File Not Found."
exit 1
fi
exit 0
}
main $*</entry>
<entry key="timeout">10</entry>
<entry key="failureThreshold">1</entry>
<entry key="warningMessage"></entry>
<entry key="warningThresholdType">min</entry>
<entry key="rearmValue">1</entry>
<entry key="warningThresholdValue">1</entry>
<entry key="monitorDescription"></entry>
</properties>
Tell me please:
1. How can I read message from log file and add it to entry with key "warningMessage"?
2. Where i can found list of reserved variable, such as $MONITOR, $INSTANCE and etc?