Hey there...
Need some help in bash scripting where I need to write code which will actually count minutes and seconds. Just like after some specific minute do the task or wait for some minutes/seconds before executing the command?
My script is polling data for concurrent number of sessions and if that crosses above threshold in my case its 100. it should send mail but whats happening here is since the polling is happening at every 5 mins and it threshold is being crossed regularly mail is forwarded every 5 min, this is what I wanted to avoid.
it goes something like this
threshold=``snmpwalk -Of -On -v 2c 1.1.1.1 -c xxxxx 1.3.6.1.4.1.12532.12 | awk '{print $NF}'`
if [ $threshold -gt 100 ];then
mail -s "Threshold crossed"
abcd@abcd.netsleep 30m
else
echo "Looks Good"
fi
crontab entry is to poll the device for every 5 min.
Please advise.