Solarwinds SMS Alerts- Batch File

Version 1

    Hello,

     

    Recently we had a requirement of Configuring SMS alerts, Where we cant call the numbers@carriercodes We don't want to spend for any third party integration. Our SMS server was having the ability to convert files into SMS. So we have created the attached batch file in Orion Server.

     

    For the alerts which we want the SMS to be triggered we called this batch file and along with all the required variables for the alert, For each alert triggered it will create a file with the Solarwinds Alert message same as you see in Email notifications along with the mobile numbers,triggered date and time will have as the file name. Once the file name is created this .bat file will copy the file to the SMS server and then SMS server process the message to send notifications. So far its working perfectly. Thought of sharing in thwack! Which might be helpful for anyone.

     

    ==================================================================================================

    for /f "tokens=1-2 delims= " %%i in ('date /t') do for /f "tokens=1-3 delims=/" %%a in ('echo %%j') do set dd=%%b%%a%%c

    for /f "tokens=1-3 delims=:" %%i in ('echo %time%') do for /f "tokens=1-2 delims=." %%a in ('echo %%i%%j%%k') do set tt=%%a%%b

     

    set smslogpath=C:\SolarwindsSMSAlert

     

    echo Mobilenumber1,%~1,Name of Sender> %smslogpath%\Nwsms%dd%%tt%.txt

    echo Mobilenumber1,%~1,Name of Sender>> %smslogpath%\Nwsms%dd%%tt%.txt

    echo Mobilenumber1,%~1,Name of Sender>> %smslogpath%\Nwsms%dd%%tt%.txt

     

    dir \\SMS Sever IP\alert_sms$

    if %errorlevel% EQU 0 goto skiplogin:

     

    NET USE \\SMS Sever IP\alert_sms$ /USER:SMS Sever IP\User ID Password

     

    :skiplogin

     

    copy /Y %smslogpath%\Nwsms%dd%%tt%.txt \\SMS Sever IP\alert_sms$\

     

    move /Y %smslogpath%\Nwsms%dd%%tt%.txt %smslogpath%\Archive\Nwsms%dd%%tt%_done.txt

    =======================================================================================================

    Replace Mobilenumber1,2,3,.... N to the list of required numbers.

    set smslogpath=C:\SolarwindsSMSAlert any desired path.

    Replace SMS Sever IP

    Provide User ID Password to access SMS Server.

     

     

     

    Please share your inputs and better options if you have!

     

    @ Network Performance Monitor

    SMSAlert.bat (819 bytes) Download