Forum Discussion
Ferg_104721
Nimbostratus
Mar 28, 2012OTP Email Setup
Hi,
I am going a little crazy here, I am tryng out the email option for the otp setup:
https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1086432/One-Time-Passwords-via-an-SMS-Gateway-with-BIG-IP-Access-Policy-Manager.aspx
I have altered the bash a little for me needs, as I need the user email to send the request. I am sending the email to a smtp server which sends to a sms provider who sms's me.
I know the command works manually (tseted it), but i can see that the grep otp is not catching from the tail. My log gets a lot of traffic.
Any suggestions?
OTP.sh
!/bin/bash
while true
do
tail-n0 -f /var/log/ltm | grep OTP | while read line
do
var2="echo $line | grep otp | awk -F'[,]' '{ print $2 }'"
var3="echo $line | grep otp | awk -F'[,]' '{ print $3 }'"
var4="echo $line | grep otp | awk -F'[,]' '{ print $4 }'"
var6="echo $line | grep otp | awk -F'[,]' '{ print $6 }'"
if [ "$var3" = "otp" -a -n "$var4" ]; then
echo Sending pin $var4 to $var2
echo One Time Password is $var4 | mail $var6@onlinesms.com -- -f $var2
fi
done
done
5 Replies
Sort By
- hoolio
Cirrostratus
Hi Ferg, - Ferg_104721
Nimbostratus
Hi Aaron - Ferg_104721
Nimbostratus
OK i think i know what the issue is, my bash script is not monitoring the log (as i can run it manually), so I have created a custom log and all I need to know now is how to make my script monitor continually. I have installed the script in /config at the moment. any thoughts. - hoolio
Cirrostratus
Hi Ferg, - Ferg_104721
Nimbostratus
I have asked for approval to add this comment to the OTP link but i put it here also incase its not approved.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects