de-vnull / vnstat-on-merlin

vnstat-on-merlin
GNU General Public License v3.0
35 stars 3 forks source link

Daily Summary Emails #31

Open novusB opened 5 months ago

novusB commented 5 months ago

Version: v2.0.5 on RT-AX3000

I am unable to enable daily summary emails in the web UI as well as the AMTM config of the addon. I have verified email test alerts are working through AMTM's EM. When I choose opt 2 in ssh, it just goes blank.

When I choose "HTML or Text" through the web UI, after saving the changes, the option goes directly back to "disabled"

amtm vnstat

Any and all assistance is appreciated. Thank you!

de-vnull commented 5 months ago

What is your email provider? Please post a screen shot of the EM setup in AMTM (blur any exposed passwords or account details for security reasons).

Do other apps that use EM work (e.g., wicens and diversion?). Have you done a full uninstall/reinstall of dn-vnstat?

novusB commented 5 months ago

I am using Office 365 business as my email provider using SMTP auth, I will post my EM setup in AMTM in a picture.

Yes, Autoupdate works, diversion works as well. Backupmon uses SMTP alerts as well.

I have not done a full uninstall/reinstall of dn-vnstat, figured I would post first and see what steps needed to be taken. I will uninstall and reinstall after this.

As requested, here is a photo of my AMTM EM settings

amtm settings1

Here is a screenshot of AMTM's backupmon successfully sending an email last night.

amtm backupmon1

novusB commented 5 months ago

First, I uninstalled and tried to keep the config, I wanted to keep the data the addon had already collected. After reinstalling with the data and config saved, the email alerts would not enable either. I uninstalled a second time, deleted saved data and my config and reinstalled. That did not work either, here are my settings within the vnstat addon.

vnstat-noemail

de-vnull commented 5 months ago

OK. I have no way of testing a MS account, but I wonder if it's something in the confirmation from the curl command used to send the email, as I previously saw with me.com messages.

I have a full day at the office today (EDT) but will look at this tonight. Because you responded overnight I assume you're outside the US or at least in the far western timezone?

novusB commented 5 months ago

OK. I have no way of testing a MS account, but I wonder if it's something in the confirmation from the curl command used to send the email, as I previously saw with me.com messages.

I have a full day at the office today (EDT) but will look at this tonight. Because you responded overnight I assume you're outside the US or at least in the far western timezone?

Hahahahaha......No, I'm just not normal. I'm in EST, USA. Michigan. I WFH so I'll be around all day. But I'm not sure if it's an issue with curl, because as soon as I even check html or text in the web UI, click save, it goes directly back to disabled.

I can create you an email on my domain and O365 environment if you'd like so you can test :)

de-vnull commented 5 months ago

Understood. I too have some odd hours (I work with Clients in Europe and Asia and domestically in San Diego, so the sun essentially never sets on my client base). Can you DM me the output of

sh -x /jffs/scripts/dn-vnstat summary

please. It might fail with an error about missing credentials, that's fine too.

Don't post it here because it'll have your email addresses and stuff in it (or remove anything personal before posting).

I might take you up on the account depending on where we get troubleshooting.

novusB commented 5 months ago

Understood. I too have some odd hours (I work with Clients in Europe and Asia and domestically in San Diego, so the sun essentially never sets on my client base). Can you DM me the output of

sh -x /jffs/scripts/dn-vnstat summary

please. It might fail with an error about missing credentials, that's fine too.

Don't post it here because it'll have your email addresses and stuff in it (or remove anything personal before posting).

I might take you up on the account depending on where we get troubleshooting.

ASUSWRT-Merlin RT-AX58U_V2 3004.388.7_1-gnuton1 Mon Jun 10 09:50:03 UTC 2024
novusB@Asus-RTAX3000:/tmp/home/root# sh -x /jffs/scripts/dn-vnstat summary
+ readonly SCRIPT_NAME=dn-vnstat
+ readonly SCRIPT_VERSION=v2.0.5
+ SCRIPT_BRANCH=main
+ SCRIPT_REPO=https://raw.githubusercontent.com/de-vnull/vnstat-on-merlin/main
+ readonly SCRIPT_DIR=/jffs/addons/dn-vnstat.d
+ readlink /www/user
+ readonly SCRIPT_WEBPAGE_DIR=/tmp/var/wwwext
+ readonly SCRIPT_WEB_DIR=/tmp/var/wwwext/dn-vnstat
+ readonly SHARED_DIR=/jffs/addons/shared-jy
+ readonly SHARED_REPO=https://raw.githubusercontent.com/jackyaz/shared-jy/maste                                                                                                                                                                                                                                             r
+ readonly SHARED_WEB_DIR=/tmp/var/wwwext/shared-jy
+ nvram get odmpid
+ [ -z RT-AX3000 ]
+ nvram get odmpid
+ ROUTER_MODEL=RT-AX3000
+ [ -f /opt/bin/sqlite3 ]
+ SQLITE3_PATH=/opt/bin/sqlite3
+ readonly CRIT=\e[41m
+ readonly ERR=\e[31m
+ readonly WARN=\e[33m
+ readonly PASS=\e[32m
+ readonly BOLD=\e[1m
+ readonly SETTING=\e[1m\e[36m
+ readonly CLEARFORMAT=\e[0m
+ [ -f /opt/share/dn-vnstat.d/config ]
+ SCRIPT_CONF=/jffs/addons/dn-vnstat.d/config
+ SCRIPT_STORAGE_DIR=/jffs/addons/dn-vnstat.d
+ CSV_OUTPUT_DIR=/jffs/addons/dn-vnstat.d/csv
+ IMAGE_OUTPUT_DIR=/jffs/addons/dn-vnstat.d/images
+ VNSTAT_COMMAND=vnstat --config /jffs/addons/dn-vnstat.d/vnstat.conf
+ VNSTATI_COMMAND=vnstati --config /jffs/addons/dn-vnstat.d/vnstat.conf
+ VNSTAT_OUTPUT_FILE=/jffs/addons/dn-vnstat.d/vnstat.txt
+ [ -z summary ]
+ NTP_Ready
+ nvram get ntp_ready
+ [ 1 -eq 0 ]
+ Entware_Ready
+ [ ! -f /opt/bin/opkg ]
+ Reset_Allowance_Warnings
+ awk {printf("%s", $1+1);}
+ date +%d
+ AllowanceStartDay check
+ cut -f2 -d
+ grep ^MonthRotate  /jffs/addons/dn-vnstat.d/vnstat.conf
+ MonthRotate=1
+ echo 1
+ [ 12 -eq 1 ]
+ [  = force ]
+ Generate_Images silent
+ Create_Dirs
+ [ ! -d /jffs/addons/dn-vnstat.d ]
+ [ ! -d /jffs/addons/dn-vnstat.d ]
+ [ ! -d /jffs/addons/dn-vnstat.d/images ]
+ [ ! -d /jffs/addons/dn-vnstat.d/csv ]
+ [ ! -d /jffs/addons/shared-jy ]
+ [ ! -d /tmp/var/wwwext ]
+ [ ! -d /tmp/var/wwwext/dn-vnstat ]
+ Conf_Exists
+ [ -f /jffs/addons/dn-vnstat.d/vnstat.conf ]
+ restartvnstat=false
+ grep -q ^MaxBandwidth 1000 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^TimeSyncWait 10 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^UpdateInterval 30 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^UnitMode 2 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^RateUnitMode 1 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^OutputStyle 0 /jffs/addons/dn-vnstat.d/vnstat.conf
+ grep -q ^MonthFormat "%Y-%m" /jffs/addons/dn-vnstat.d/vnstat.conf
+ [ false = true ]
+ [ -f /jffs/addons/dn-vnstat.d/config ]
+ dos2unix /jffs/addons/dn-vnstat.d/config
+ chmod 0644 /jffs/addons/dn-vnstat.d/config
+ sed -i -e s/"//g /jffs/addons/dn-vnstat.d/config
+ grep -q STORAGELOCATION /jffs/addons/dn-vnstat.d/config
+ grep -q OUTPUTTIMEMODE /jffs/addons/dn-vnstat.d/config
+ return 0
+ ScriptStorageLocation load
+ + cut -f2 -d=
grep STORAGELOCATION /jffs/addons/dn-vnstat.d/config
+ STORAGELOCATION=usb
+ [ usb = usb ]
+ SCRIPT_STORAGE_DIR=/opt/share/dn-vnstat.d
+ CSV_OUTPUT_DIR=/opt/share/dn-vnstat.d/csv
+ IMAGE_OUTPUT_DIR=/opt/share/dn-vnstat.d/images
+ VNSTAT_COMMAND=vnstat --config /opt/share/dn-vnstat.d/vnstat.conf
+ VNSTATI_COMMAND=vnstati --config /opt/share/dn-vnstat.d/vnstat.conf
+ VNSTAT_OUTPUT_FILE=/opt/share/dn-vnstat.d/vnstat.txt
+ Create_Symlinks
+ rm -rf /tmp/var/wwwext/dn-vnstat/config.htm /tmp/var/wwwext/dn-vnstat/csv /tmp                                                                                                                                                                                                                                             /var/wwwext/dn-vnstat/detect_vnstat.js /tmp/var/wwwext/dn-vnstat/images /tmp/var                                                                                                                                                                                                                                             /wwwext/dn-vnstat/vnstatconf.htm /tmp/var/wwwext/dn-vnstat/vnstatoutput.htm /tmp                                                                                                                                                                                                                                             /var/wwwext/dn-vnstat/vnstatusage.js
+ ln -s /tmp/detect_vnstat.js /tmp/var/wwwext/dn-vnstat/detect_vnstat.js
+ ln -s /opt/share/dn-vnstat.d/.vnstatusage /tmp/var/wwwext/dn-vnstat/vnstatusag                                                                                                                                                                                                                                             e.js
+ ln -s /opt/share/dn-vnstat.d/vnstat.txt /tmp/var/wwwext/dn-vnstat/vnstatoutput                                                                                                                                                                                                                                             .htm
+ ln -s /jffs/addons/dn-vnstat.d/config /tmp/var/wwwext/dn-vnstat/config.htm
+ ln -s /opt/share/dn-vnstat.d/vnstat.conf /tmp/var/wwwext/dn-vnstat/vnstatconf.                                                                                                                                                                                                                                             htm
+ ln -s /opt/share/dn-vnstat.d/images /tmp/var/wwwext/dn-vnstat/images
+ ln -s /opt/share/dn-vnstat.d/csv /tmp/var/wwwext/dn-vnstat/csv
+ [ ! -d /tmp/var/wwwext/shared-jy ]
+ Auto_Startup create
+ Auto_Cron create
+ Auto_ServiceEvent create
+ Shortcut_Script create
+ [ -d /opt/bin ]
+ [ ! -f /opt/bin/dn-vnstat ]
+ Process_Upgrade
+ [ ! -f /opt/share/dn-vnstat.d/.vnstatusage ]
+ grep -q ^UseUTC 0 /opt/share/dn-vnstat.d/vnstat.conf
+ [ false = true ]
+ [ ! -f /opt/lib/libjpeg.so ]
+ cat /etc/TZ
+ TZ=EST5DST,M3.2.0/2,M11.1.0/2
+ export TZ
+ [ -z silent ]
+ grep ^Interface /opt/share/dn-vnstat.d/vnstat.conf
+ awk {print $2}
+ sed s/"//g
+ interface=eth0
+ outputs=s hg d t m
+ vnstati --config /opt/share/dn-vnstat.d/vnstat.conf -s -i eth0 -o /opt/share/d                                                                                                                                                                                                                                             n-vnstat.d/images/vnstat_s.png
+ vnstati --config /opt/share/dn-vnstat.d/vnstat.conf -hg -i eth0 -o /opt/share/                                                                                                                                                                                                                                             dn-vnstat.d/images/vnstat_hg.png
+ vnstati --config /opt/share/dn-vnstat.d/vnstat.conf -d 31 -i eth0 -o /opt/shar                                                                                                                                                                                                                                             e/dn-vnstat.d/images/vnstat_d.png
+ vnstati --config /opt/share/dn-vnstat.d/vnstat.conf -m 12 -i eth0 -o /opt/shar                                                                                                                                                                                                                                             e/dn-vnstat.d/images/vnstat_m.png
+ vnstati --config /opt/share/dn-vnstat.d/vnstat.conf -t 10 -i eth0 -o /opt/shar                                                                                                                                                                                                                                             e/dn-vnstat.d/images/vnstat_t.png
+ sleep 1
+ cp /opt/share/dn-vnstat.d/images/vnstat_s.png /opt/share/dn-vnstat.d/images/.v                                                                                                                                                                                                                                             nstat_s.htm
+ rm -f /opt/share/dn-vnstat.d/images/vnstat_s.htm
+ cp /opt/share/dn-vnstat.d/images/vnstat_hg.png /opt/share/dn-vnstat.d/images/.                                                                                                                                                                                                                                             vnstat_hg.htm
+ rm -f /opt/share/dn-vnstat.d/images/vnstat_hg.htm
+ cp /opt/share/dn-vnstat.d/images/vnstat_d.png /opt/share/dn-vnstat.d/images/.v                                                                                                                                                                                                                                             nstat_d.htm
+ rm -f /opt/share/dn-vnstat.d/images/vnstat_d.htm
+ cp /opt/share/dn-vnstat.d/images/vnstat_t.png /opt/share/dn-vnstat.d/images/.v                                                                                                                                                                                                                                             nstat_t.htm
+ rm -f /opt/share/dn-vnstat.d/images/vnstat_t.htm
+ cp /opt/share/dn-vnstat.d/images/vnstat_m.png /opt/share/dn-vnstat.d/images/.v                                                                                                                                                                                                                                             nstat_m.htm
+ rm -f /opt/share/dn-vnstat.d/images/vnstat_m.htm
+ Generate_Stats silent
+ [ ! -f /opt/bin/xargs ]
+ [ -n 27481 ]
+ ps
+ grep -v 28492
+ xargs kill -9
+ grep -v 27481
+ grep -i dn-vnstat
+ grep -v grep
+ awk {print $1}
+ grep generate
+ sleep 3
+ Create_Dirs
+ [ ! -d /jffs/addons/dn-vnstat.d ]
+ [ ! -d /opt/share/dn-vnstat.d ]
+ [ ! -d /opt/share/dn-vnstat.d/images ]
+ [ ! -d /opt/share/dn-vnstat.d/csv ]
+ [ ! -d /jffs/addons/shared-jy ]
+ [ ! -d /tmp/var/wwwext ]
+ [ ! -d /tmp/var/wwwext/dn-vnstat ]
+ Conf_Exists
+ [ -f /opt/share/dn-vnstat.d/vnstat.conf ]
+ restartvnstat=false
+ grep -q ^MaxBandwidth 1000 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^TimeSyncWait 10 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^UpdateInterval 30 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^UnitMode 2 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^RateUnitMode 1 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^OutputStyle 0 /opt/share/dn-vnstat.d/vnstat.conf
+ grep -q ^MonthFormat "%Y-%m" /opt/share/dn-vnstat.d/vnstat.conf
+ [ false = true ]
+ [ -f /jffs/addons/dn-vnstat.d/config ]
+ dos2unix /jffs/addons/dn-vnstat.d/config
+ chmod 0644 /jffs/addons/dn-vnstat.d/config
+ sed -i -e s/"//g /jffs/addons/dn-vnstat.d/config
+ grep -q STORAGELOCATION /jffs/addons/dn-vnstat.d/config
+ grep -q OUTPUTTIMEMODE /jffs/addons/dn-vnstat.d/config
+ return 0
+ ScriptStorageLocation load
+ grep STORAGELOCATION /jffs/addons/dn-vnstat.d/config
+ cut -f2 -d=
+ STORAGELOCATION=usb
+ [ usb = usb ]
+ SCRIPT_STORAGE_DIR=/opt/share/dn-vnstat.d
+ CSV_OUTPUT_DIR=/opt/share/dn-vnstat.d/csv
+ IMAGE_OUTPUT_DIR=/opt/share/dn-vnstat.d/images
+ VNSTAT_COMMAND=vnstat --config /opt/share/dn-vnstat.d/vnstat.conf
+ VNSTATI_COMMAND=vnstati --config /opt/share/dn-vnstat.d/vnstat.conf
+ VNSTAT_OUTPUT_FILE=/opt/share/dn-vnstat.d/vnstat.txt
+ Create_Symlinks
+ rm -rf /tmp/var/wwwext/dn-vnstat/config.htm /tmp/var/wwwext/dn-vnstat/csv /tmp/var/wwwext/dn-vnstat/detect_vnstat.js /tmp/var/wwwext/dn-vnstat/images /tmp/var/wwwext/dn-vnstat/vnstatconf.htm /tmp/var/wwwext/dn-vnstat/vnstatoutput.htm /tmp/var/wwwext/dn-vnstat/vnstatusage.js
+ ln -s /tmp/detect_vnstat.js /tmp/var/wwwext/dn-vnstat/detect_vnstat.js
+ ln -s /opt/share/dn-vnstat.d/.vnstatusage /tmp/var/wwwext/dn-vnstat/vnstatusage.js
+ ln -s /opt/share/dn-vnstat.d/vnstat.txt /tmp/var/wwwext/dn-vnstat/vnstatoutput.htm
+ ln -s /jffs/addons/dn-vnstat.d/config /tmp/var/wwwext/dn-vnstat/config.htm
+ ln -s /opt/share/dn-vnstat.d/vnstat.conf /tmp/var/wwwext/dn-vnstat/vnstatconf.htm
+ ln -s /opt/share/dn-vnstat.d/images /tmp/var/wwwext/dn-vnstat/images
+ ln -s /opt/share/dn-vnstat.d/csv /tmp/var/wwwext/dn-vnstat/csv
+ [ ! -d /tmp/var/wwwext/shared-jy ]
+ Auto_Startup create
+ Auto_Cron create
+ Auto_ServiceEvent create
+ Shortcut_Script create
+ [ -d /opt/bin ]
+ [ ! -f /opt/bin/dn-vnstat ]
+ Process_Upgrade
+ [ ! -f /opt/share/dn-vnstat.d/.vnstatusage ]
+ grep -q ^UseUTC 0 /opt/share/dn-vnstat.d/vnstat.conf
+ [ false = true ]
+ grep ^Interface /opt/share/dn-vnstat.d/vnstat.conf
+ awk+ sed s/"//g
 {print $2}
+ interface=eth0
+ cat /etc/TZ
+ TZ=EST5DST,M3.2.0/2,M11.1.0/2
+ export TZ
+ date
+ printf vnstats as of: %s\n\n Tue Jun 11 19:46:56 DST 2024
+ vnstat --config /opt/share/dn-vnstat.d/vnstat.conf -h 25 -i eth0
+ vnstat --config /opt/share/dn-vnstat.d/vnstat.conf -d 8 -i eth0
+ vnstat --config /opt/share/dn-vnstat.d/vnstat.conf -m 6 -i eth0
+ vnstat --config /opt/share/dn-vnstat.d/vnstat.conf -y 5 -i eth0
+ [ -z silent ]
+ [ -z silent ]
+ [ -z silent ]
+ Check_Bandwidth_Usage silent
+ [ ! -f /opt/bin/jq ]
+ cat /etc/TZ
+ TZ=EST5DST,M3.2.0/2,M11.1.0/2
+ export TZ
+ grep+  ^Interfaceawk {print $2}
 /opt/share/dn-vnstat.d/vnstat.conf
+ sed s/"//g
+ interface=eth0
+ vnstat --config /opt/share/dn-vnstat.d/vnstat.conf -i eth0 --json m
+ jq -r .interfaces[].traffic.month[-1] | .rx + .tx
+ rawbandwidthused=24364290953
+ BandwidthAllowance check
+ grep DATAALLOWANCE+ cut -f2 -d=
 /jffs/addons/dn-vnstat.d/config
+ DATAALLOWANCE=
+ echo
+ userLimit=
+ echo 24364290953
+ awk {printf("%.2f\n", $1/(1000*1000*1000));}
+ bandwidthused=24.36
+ AllowanceUnit check
+ grep -q T
+ cut -f2+ grep ALLOWANCEUNIT /jffs/addons/dn-vnstat.d/config
 -d=
+ ALLOWANCEUNIT=
+ echo B
+ bandwidthpercentage=
+ usagestring=
+ echo  0
+ awk {print ($1 == $2)}
+ [ 1 -eq 1 ]
+ bandwidthpercentage=N/A
+ AllowanceUnit check
+ grep ALLOWANCEUNIT /jffs/addons/dn-vnstat.d/config
+ cut -f2 -d=
+ ALLOWANCEUNIT=
+ echo B
+ AllowanceStartDay check
+ grep+  ^MonthRotate cut /opt/share/dn-vnstat.d/vnstat.conf -f2
 -d
+ MonthRotate=1
+ echo 1
+ usagestring=You have used 24.36B of data this cycle; the next cycle starts on day 1 of the month.
+ [ -z silent ]
+ [ N/A = N/A ]
+ echo var usagethreshold = false;
+ echo var thresholdstring = "";
+ printf var usagestring = "%s";\n You have used 24.36B of data this cycle; the next cycle starts on day 1 of the month.
+ date +%Y-%m-%d %T
+ printf var daterefeshed = "%s";\n 2024-06-11 19:46:56
+ DailyEmail check
+ grep DAILYEMAIL /jffs/addons/dn-vnstat.d/config
+ cut -f2 -d=
+ DAILYEMAIL=
+ echo
+ [  != none ]
+ Generate_Email daily
+ [ -f /jffs/addons/amtm/mail/email.conf ]
+ [ -f /jffs/addons/amtm/mail/emailpw.enc ]
+ . /jffs/addons/amtm/mail/email.conf
+ FROM_ADDRESS=novusB@novusb.com
+ TO_NAME=novusB
+ TO_ADDRESS=REDACTED@gmail.com
+ FRIENDLY_ROUTER_NAME=AX3000
+ USERNAME=novusB@novusb.com
+ SMTP=smtp.office365.com
+ PORT=587
+ PROTOCOL=smtp
+ SSL_FLAG=
+ emailPwEnc=-pbkdf2
+ PWENCFILE=/jffs/addons/amtm/mail/emailpw.enc
+ PASSWORD=
+ /usr/sbin/openssl aes-256-cbc -d -in /jffs/addons/amtm/mail/emailpw.enc -pass pass:ditbabot,isoi
+ /usr/sbin/openssl aes-256-cbc -d -md md5 -in /jffs/addons/amtm/mail/emailpw.enc -pass pass:ditbabot,isoi
+ /usr/sbin/openssl aes-256-cbc -pbkdf2 -d -in /jffs/addons/amtm/mail/emailpw.enc -pass pass:ditbabot,isoi
+ /usr/sbin/openssl aes-256-cbc -pbkdf2 -d -in /jffs/addons/amtm/mail/emailpw.enc -pass pass:ditbabot,isoi
+ PASSWORD=REDACTEDPASSWORD
+ emailtype=daily
+ [ daily = daily ]
+ Print_Output true Attempting to send summary statistic email
+ [ true = true ]
+ logger -t dn-vnstat Attempting to send summary statistic email
+ printf \e[1m%s\e[0m\n\n Attempting to send summary statistic email
Attempting to send summary statistic email

+ DailyEmail check
+ + cut -f2 -d=
grep DAILYEMAIL /jffs/addons/dn-vnstat.d/config
+ DAILYEMAIL=
+ echo
+ [  = text ]
+ DailyEmail check
+ grep DAILYEMAIL /jffs/addons/dn-vnstat.d/config
+ cut -f2 -d=
+ DAILYEMAIL=
+ echo
+ [  = html ]
+ /usr/sbin/curl -s --show-error --url smtp://smtp.office365.com:587 --mail-from novusB@novusb.com --mail-rcpt REDACTED@gmail.com --upload-file /tmp/mail.txt --ssl-reqd --crlf --user novusB@novusb.com:REDACTEDPASSWORD
curl: Can't open '/tmp/mail.txt'
curl: try 'curl --help' for more information
curl: (26) Failed to open/read local data from file/application
+ [ 26 -eq 0 ]
+ echo

+ [ -z  ]
+ Print_Output true Email failed to send \e[31m
+ [ true = true ]
+ logger -t dn-vnstat Email failed to send
+ printf \e[1m\e[31m%s\e[0m\n\n Email failed to send
Email failed to send

+ rm -f /tmp/mail.txt
+ PASSWORD=
+ return 1
+ exit 0

Let me know if you need anything else.

novusB commented 5 months ago

Do you need anymore info from me thus far?

de-vnull commented 5 months ago

No, I've been busy with clients this week. Plan to look at it this weekend.

de-vnull commented 5 months ago

OK, I've looked back through changes and your text is similar to the icloud issue.

Before I do additional troubleshooting, can you try replacing the MS credentials with gmail or outlook.com credentials to make sure it's not something particular to your specific setup? I expect it will work fine with the alternative provider (which could be a solution, but I'd like to sort out the MS account thing if we can).

And since I don't have an MS account to try (only a work-related account), I cannot troubleshoot further, so in that case I'd like to take you up on your offer of a temp account. Perhaps it could be dev_null@ your domain so you can account for anything I do.

Could you DM me the password via snbforums so we have account details in two separate systems for security?

I'm headed out of town this coming weekend, so have a few days before then, otherwise I'll be back after the 4th July.

Cheers,

novusB commented 5 months ago

Do you use discord?

I can use one of my alt gmail accounts. Just weird how every other script has 0 issues with the smtp feature. Figured your script would use the built in smtp function of amtm.

de-vnull commented 5 months ago

The credentials are shared between apps but each app has custom commands and methods for handling different actions.

Yes I do have discord, though I don't use it often. Username de_vnull4467.

Martinski4GitHub commented 2 months ago

Version: v2.0.5 on RT-AX3000

I am unable to enable daily summary emails in the web UI as well as the AMTM config of the addon. I have verified email test alerts are working through AMTM's EM. When I choose opt 2 in ssh, it just goes blank.

When I choose "HTML or Text" through the web UI, after saving the changes, the option goes directly back to "disabled"

Have you already resolved the issue with the "Emails for Daily Summary Stats" setting?

If it's resolved, then you can ignore this post.

If not resolved, I've submitted PR #32 which includes code improvements to properly handle reading & checking for configuration file settings. Based on the debug output you posted when executing the following command:

sh -x /jffs/scripts/dn-vnstat summary

All signs point to an issue with handling the configuration file because the current code is not properly doing error checking & recovery when reading & validating configuration settings.

If you want to try the new fixed script "2.0.6" version you can download it to your router using the following command:

curl -LSs --retry 4 --retry-delay 5 --retry-connrefused \
https://raw.githubusercontent.com/de-vnull/vnstat-on-merlin/3481ad5d0cdcd991451d44a91d0fed678f97c4b6/dn-vnstat.sh \
-o /jffs/scripts/dn-vnstat && chmod a+x /jffs/scripts/dn-vnstat

HTH.