Jump to content

Recommended Posts

Posted

Hello all,

 

I still use Intel Matrix 8.x on my 2003 and 2008 R2 servers and it does everything apart from e-mail notifications. This is where Intel promote Rapid Storage Technology 10.x (Intel Matrix's replacement), but what they don't tell you is e-mail notifications only work on newer Intel chipsets. How ridiculous!

 

I've found a way here how to send e-mail notifications (which works great) on 2008 R2, but how can I achieve this on 2003 Server? I use bmail.exe to e-mail NTBackup logs, so I need something similar to send an e-mail when an event is logged. TIA.

Posted

For those interested, here's how you can achieve the same thing on 2003 Server. This uses a built in function called eventtriggers.exe.

 

If you run the below from a command prompt, you can get more info:

 

eventtriggers /?

 

Firstly you need bmail.exe which you can download here. I already use this to e-mail NTBackup log files to my e-mail address daily (see next post).

 

Save this to C:\Windows\Backup

 

Create a new text file in C:\Windows\Backup called raidmessage.txt and insert the following, then save it:

 

Server RAID Degraded on SERVERNAME @ SCHOOL

 

Create a second text file in C:\Windows\Backup called trigger.bat and insert the following, then save it:

 

@echo off

:: Name this script 
SET _SCRIPTNAME=Degraded!

:: Define message parameters 
set _LOGLOCATION=%systemroot%\Backup\raidmessage.txt
set _Text2Mail=%systemdrive%\bmailtext.txt 

:: Define bmail parameters
:: EXELOCATION is the location of the BMAIL Executable.
set _EXELOCATION=%systemroot%\Backup
set _SMTPSERVER=ENTER SMTP
set _TOADDR=ENTER YOUR E-MAIL ADDRESS
set _FROMADDR=ENTER FROM E-MAIL ADDRESS
set _SUBJECT="Server RAID %_SCRIPTNAME%"

:: Because of the formatting of the logfile, not all email programs render it properly. 
:: Therefore we output the contents of the logfile to a plain ASCII text file. 
type "%_LogLocation%" >> %_Text2Mail% 

:: Send our email using the ASCII text file generated above as the message body. 
%_EXELOCATION%\bmail -s %_SMTPSERVER% -t %_TOADDR% -f %_FROMADDR% -a %_SUBJECT% -m "%_Text2Mail%" -c 

:: Delete our text file 
del %_Text2Mail%

 

Open a command prompt and enter:

 

eventtriggers /create /eid 7202 /tr EventID7202 /ru ADMINISTRATOR /rp PASSWORD /tk C:\Windows\Backup\trigger.bat

 

You should see:

 

SUCCESS: The event trigger "EventID7202" has been created.

 

If you wish to query it, enter:

 

H:\>eventtriggers /query

 

You should see this:

 

Trigger ID Event Trigger Name        Task
========== ========================= ========================================
        1 EventID7202               C:\Windows\Backup\trigger.bat

 

Please note, I cannot take credit for all the code, but only some of it! :) I hope this helps you setup all kinds of other triggers! :)

Posted

Here’s how I use bmail.exe to send NTBackup logs to my e-mail on 2003 Server:

 

Create a new text file in C:\Windows\Backup called Backuplogs.bat and insert the following, then save it:

 

@echo off

:: Name this script 
SET _SCRIPTNAME=SCHOOL NAME SERVERNAME

:: Define backup logfile parameters 
set _LOGLOCATION=%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
set _Text2Mail=%systemdrive%\bmailtext.txt 

:: Define bmail parameters
:: EXELOCATION is the location of the BMAIL Executable.
set _EXELOCATION=%systemroot%\Backup
set _SMTPSERVER=ENTER SMTP
set _TOADDR=ENTER YOUR E-MAIL ADDRESS
set _FROMADDR=ENTER FROM E-MAIL ADDRESS
set _SUBJECT="Backup Log for %_SCRIPTNAME%"

:: Find most recent logfile. 
:: Using the /od  option of the DIR command lists the files in the order they were last modified, newest being on the bottom. 
:: The /b option removes any other formatting from the output of the DIR command.
for /f %%j in ('dir "%_LOGLOCATION%\backup*.log" /od /b') do set _currentLog=%%j 

:: Because of the formatting of the logfile, not all email programs render it properly. 
:: Therefore we output the contents of the logfile to a plain ASCII text file. 
type "%_LogLocation%\%_CurrentLog%" >> %_Text2Mail% 

:: Send our email using the ASCII text file generated above as the message body. 
%_EXELOCATION%\bmail -s %_SMTPSERVER% -t %_TOADDR% -f %_FROMADDR% -a %_SUBJECT% -m "%_Text2Mail%" -c 

:: Delete our text file 
del %_Text2Mail%

 

Create a Scheduled Task to run Backuplogs.bat located in C:\Windows\Backup at 8am every morning, or however often you want to set the schedule.

 

Please note, I cannot take credit for all the code, but only some of it! :) I hope this helps you setup e-mailing NTBackup logs to yourself! :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...