Menu

How are people getting status updates? I can't find working email solution.

Help
Nick Buol
2022-12-09
2022-12-12
  • Nick Buol

    Nick Buol - 2022-12-09

    I run SnapRAID jobs daily for sync and scrubs, and I was using Swithmail to email me daily updates after those jobs ran, but I can't seem to get it working any more due to Google locking out "less secure apps" from authenticating to my GMail account to send the email.

    I could possibly create an account elsewhere and have it work, but I know Hotmail (old email for me) wouldn't work either. I assume that it is a matter of time before all mainstream email providers lock these things out too where you can't do command line emails anymore.

    Is there something else that I should use to email me my log statuses, or another tool that can send me SnapRAID log information from my media server that is running SnapRAID so that I know daily that everything is OK or has an issue? Or should I just try more free email services until I get one to work and deal with this again in the future (Hotmail failed first, now GMail, so it will happen again)?

    I am using a script that puts any error message from the sync log into the subject of the email, or a message stating that everything is ok and attaches the log. I didn't create this script, but I am sharing it in case someone else wants to use it for themselves. Just have to figure out an alternative for SwithMail or use an email system that isn't as "secure" as Google wants to be.

    Again, any help would be great on how to get something like this working again. Thank you.

    Echo Working. Please wait...
    c:
    cd\snapraid
    echo %date% %time% > RaidStatus.txt
    snapraid status >> RaidStatus.txt
    REM C:\snapraid\snapraid status >RaidStatus.txt 2>&1
    FOR %%A IN ("C:\snapraid\snapraid.content") DO @ECHO=%%~tA >>RaidStatus.txt

    SET result="SnapRaid OK"

    findstr /m /c:"WARNING!" RaidStatus.txt
    if %errorlevel%==0 SET result="WARNING! Snapraid Fail!-WARNING"

    findstr /m /c:"No sync is in progress." RaidStatus.txt
    if %errorlevel%==1 SET result="WARNING! Snapraid Fail!-SYNC IN PROGRESS"

    findstr /m /c:"No rehash is in progress or needed." RaidStatus.txt
    if %errorlevel%==1 SET result="WARNING! Snapraid Fail!-REHASH NEEDED"

    findstr /m /c:"No error detected." RaidStatus.txt
    if %errorlevel%==1 SET result="WARNING! Snapraid Fail!-ERROR DETECTED"

    for /F "skip=1 delims=" %%F in ('
    wmic PATH Win32LocalTime GET Day^,Month^,Year /FORMAT:TABLE
    ') do (
    for /F "tokens=1-3" %%L in ("%%F") do (
    set CurrDay=0%%L
    set CurrMonth=0%%M
    set CurrYear=%%N
    )
    )
    set CurrDay=%CurrDay:~-2%
    set CurrMonth=%CurrMonth:~-2%

    findstr /m %CurrMonth%/%CurrDay%/%CurrYear% RaidStatus.txt
    if %errorlevel%==1 SET result="WARNING! Snapraid Fail!-CHECK DATE RUN"

    cd\SwithMail
    echo %Results%
    SwithMail.exe /s /XML "SwithMailSettings.xml" /Subject %Result% /btxt "c:\snapraid\RaidStatus.txt"
    cd\snapraid

     

    Last edit: Nick Buol 2022-12-09
  • Nick Buol

    Nick Buol - 2022-12-11

    Nevermind on the email alternative. I just set up a free outlook.com email address and it is working with SwithMail. I suspect that it too will stop working at some point in the future, so alternative ways to get statuses emailed to them or in a way that can be easily seen on a computer that isn't running the SnapRAID instance would be great.

     
  • Charles Grisamore

    I use Sendgrid (https://sendgrid.com/pricing/) to send notifications to my Gmail account.

    Free tier allows up to 100 emails per day and works great for server notifications.

     

Log in to post a comment.

MongoDB Logo MongoDB