What's new

Asus Merlin RT-AC87U: 384.13_10 and Email Notifications

Louis James

New Around Here
I'm curious if there is an email notification about status on certain areas of the router. For example, I just discovered the wonder of Split Tunneling on the OpenVPN Client. What a godsend!!! I have the client setup with ExpressVPN. Works Wonders. I do have the "kill switch" setup where if the tunnel goes done, it blocks traffic to that device. In my case, an ATA (Telephone Adapter).

I've been told (whether it's true or not is another story) that I can get an email telling me that the tunnel has gone down. I could imagine a simple SMS Email to [email protected]. that would have a short SMS - theOpenVPN Client Settings#1 (Client Instance Name) is disconnect. And when it came back up, another SMS saying that it's back up with the Public IP address it got.

But can't find anywhere in the GUI any setting of that sort. Could it be possible?

Here's hoping. By the way, the ONLY device on that tunnel is the Telephone Adapter. So using a computer on that tunnel, I don't think is an option.

Thanks for hearing this out.

Louis
 

grifo

Regular Contributor
There is no support for email notifications on the GUI, it can be done by using custom scripts. Try searching the forum if someone has done this before or for examples of similar scripts.
 

Jeffrey Young

Regular Contributor
I use the script below to email me when needed. I call the script from other scripts as required with as "smail.sh text_body.txt subject_line"

You may be able to wan-event script to capture what you want to do. Call the mail script after you build the body.txt file with what ever you want to be mailed.

I use a gmail account to send me info. For it to work reliably, I had to set up a "App Password" in the gmail security section for the account. That gives you a fixed password that gmail recognizes as coming from an automated app and accepts it as is without the other security hoops to jump.

As far as the certificate is concerned, you can get a certificate here;

https://github.com/RMerl/asuswrt-merlin.ng/wiki/Sending-Email

or with this;

Code:
#!/bin/sh

wget -c -O $1 http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.pem --no-check-certificate
Code:
#!/bin/sh

# Send mail alert to administrator
#
# usage:
#    smail.sh text_body subject_line

if ! [ $# -eq 2 ]
then
    printf "Not enough Arguments\n\n"
    printf "Usage: smail.sh <email_body> <subject_line>\n\n"
    exit
fi

if ! [ -e $1 ]
then
    printf "File %s does not exit\n\n" $1
    exit
fi


FROM="[email protected]"
AUTH="[email protected]"
PASS="XXXX XXXX XXXX XXXX"
FROMNAME="Your Router"
TO="recipient_email"

echo "Subject: "$2 >/tmp/mail.txt
echo "From: $FROMNAME <$FROM>" >>/tmp/mail.txt
echo "Date:  $(date -R)" >>/tmp/mail.txt

cat $1 >>/tmp/mail.txt

echo "" >>/tmp/mail.txt

cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/gmail2.pem \
-connect smtp.gmail.com:587 -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO

#rm /tmp/mail.txt
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top