Link to home
Start Free TrialLog in
Avatar of westone
westoneFlag for United States of America

asked on

Eventriggers.exe

Hi,
I have created (actually got it from experts here) an event trigger on a 2003 server to watch for error type events in the Application log, and run a script (which I got from experts here as well) which emails a notification of the event with details of the log entry.

Right away I realized I want a notification of error and warning type events in any of the logs. In order to generate an email with specific info about which type of event was generated in which log, is it necessary to create a trigger for each type of event, for each log, to fire off a script appropriate for the log and event type?

Or is it possible to have the script determine which log had an event added, and generate an e-mail with content about the specific event and which log it was created in?

As it is, with my limited knowledge of scripting, my best thinking at this point is to create 4 triggers (2 triggers to watch for Warnings in App and System log, and 2 for Errors), each to run an individualized script for the entry type and log in which it was generated.

Thanks for the help. Bill
Avatar of Don
Don
Flag of United States of America image

How to use Eventtriggers.exe to send e-mail based on Event IDs


http://www.petri.co.il/how-to-use-eventtriggers.exe-to-send-e-mail-based-on-event-ids.htm

Hi, as far as I can see, you *would* have to create four triggers, being:
EVENTTRIGGERS /Create /TR "System Log Error" /L SYSTEM /T ERROR /TK wscript.exe C:\MyScript.vbs
EVENTTRIGGERS /Create /TR "System Log Warning" /L SYSTEM /T WARNING /TK wscript.exe C:\MyScript.vbs
EVENTTRIGGERS /Create /TR "Application Log Error" /L APPLICATION /T ERROR /TK wscript.exe C:\MyScript.vbs
EVENTTRIGGERS /Create /TR "Application Log Warning" /L APPLICATION /T WARNING /TK wscript.exe C:\MyScript.vbs

*however*, if MyScript.vbs was written well enough, you'd be able to get away with using only one script file, by passing it arguments from the EventTriggers command line, describing which action it was.

I'll see if I can knock up a script to show you what I mean....

Regards,

Rob.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westone

ASKER

RobSampson, I wondered about the ability to pass information from the triggering event to the called script, but I did not see how it could be done. I need some babysitting on this: In your example, <computername> is derived from the system on which the triggering event takes place, but I don't see where that is used in the script. Is the argument passed to one of the variables in the script without otherwise declaring it?
The script itself will "withdraw" its information, the trigger is just the switch that calls the script.

I.E. when a certain event(your trigger) happens then your script.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westone

ASKER

You guys are awesome, this is going to really help a lot. I am going to tweak this event triggering/script process on a server, and hopefully end up putting it on all the Windows servers and XP clients I am responsible for. Instead of monitoring all those machines Event logs for errors, I will be notified when one needs attention.
Thanks,
Bill
Cool, Good luck!!!
Assist???