|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Script Triggered Following a Specific System EventWe are running Oracle and SAP on a Win 2000 server. Once or twice a week, the Windows server logs a system event of type 'error' and source='eventlog' ,which shuts Oracle down. Not much information is contained in the event description. There aren't any scheduled tasks at that time..To resolve this, and other, issues, we are looking to move the Oracle/SAP systems to a better Win2003 server. However, until that task will be completed, we are also looking a way to trigger a job which will execute a command script (*.cmd file) to start Oracle and SAP after Oracle crashes (Again, the event log is type 'error' and source 'eventlog'). So, can anybody please tell me whether it is possible to configure Win2000 to run a certain script after an event of type 'error and source 'eventlog' occurs? I checked the Alerts in Comp. Management, but did not find anything there (Perhaps I missed something). Thanks, DF <basis_consult***@hotmail.com> wrote in message
Show quoteHide quote news:476cca8e-13e3-40f8-a261-993a777069b2@b32g2000hsa.googlegroups.com... I don't think there is such an inbuilt function. You could use the following> Hi, > > We are running Oracle and SAP on a Win 2000 server. Once or twice a > week, the Windows server logs a system event of type 'error' and > source='eventlog' ,which shuts Oracle down. > Not much information is contained in the event description. > > There aren't any scheduled tasks at that time..To resolve this, and > other, issues, we are looking to move the Oracle/SAP systems to a > better Win2003 server. > > However, until that task will be completed, we are also looking a way > to trigger a job which will execute a command script (*.cmd file) to > start Oracle and SAP after Oracle crashes (Again, the event log is > type 'error' and source 'eventlog'). > > So, can anybody please tell me whether it is possible to configure > Win2000 to run a certain script after an event of type 'error and > source 'eventlog' occurs? I checked the Alerts in Comp. Management, > but did not find anything there (Perhaps I missed > something). > > > > Thanks, > DF script to do the job. Here is what you need to do: 1. Save the script into c:\Windows\monitor.vbs on your server. 2. Change the various EMail settings to suit your environment. 3. Invoke and test the script like so from a Command Prompt: script //nologo c:\windows.vbs net stop schemes net stop schemes Each time you stop the Themes service, you should get a screen message and an email notification. You can start/stop some other harmless service if you wish. Press Ctrl+C to stop the script. 4. Find out the Oracle event code from your server's Event Viewer, then replace the current script code (7036) with the correct code. 5. Stop and restart the script. Set objWMIService = GetObject("winmgmts:{(Security)}\\.\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("Select * from __InstanceCreationEvent Where " _ & "TargetInstance ISA 'Win32_NTLogEvent' " _ & "and TargetInstance.EventCode = '7036' ") Do Set objLatestEvent = colMonitoredEvents.NextEvent WScript.Echo objLatestEvent.TargetInstance.Message WScript.Echo Send Loop '======================== Function Send Dim sender, receiver, subject, body Dim server, user, password, schema sender = "J***@ISP.com" receiver = "J***@hotmail.com" subject = "Oracle failure" body = "Oracle has shut down" server = "mail.ISP.com" user = "J***@ISP.com" password = "SomePassword" schema = "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = CreateObject("CDO.Message") With objEmail .From = sender .To = receiver .Subject = subject .Textbody = body ' .AddAttachment "d:\Testfile.txt" With .Configuration.Fields .Item (schema & "sendusing") = 2 .Item (schema & "smtpserver") = server .Item (schema & "smtpserverport") = 25 .Item (schema & "smtpauthenticate") = cdoBasic .Item (schema & "sendusername") = user .Item (schema & "sendpassword") = password End With .Configuration.Fields.Update .Send End With end function Hi,
Thanks for the reply. DF On Nov 20, 3:23 pm, "basis_consult***@hotmail.com" <basis_consult***@hotmail.com> wrote: Show quoteHide quote > Hi, > > We are running Oracle and SAP on a Win 2000 server. Once or twice a > week, the Windows server logs a system event of type 'error' and > source='eventlog' ,which shuts Oracle down. > Not much information is contained in the event description. > > There aren't any scheduled tasks at that time..To resolve this, and > other, issues, we are looking to move the Oracle/SAP systems to a > better Win2003 server. > > However, until that task will be completed, we are also looking a way > to trigger a job which will execute a command script (*.cmd file) to > start Oracle and SAP after Oracle crashes (Again, the event log is > type 'error' and source 'eventlog'). > > So, can anybody please tell me whether it is possible to configure > Win2000 to run a certain script after an event of type 'error and > source 'eventlog' occurs? I checked the Alerts in Comp. Management, > but did not find anything there (Perhaps I missed > something). > > Thanks, > DF
Other interesting topics
Help - Password Error
Blue Screen-----Stop Permissions to save in directory!!1 I screwed up my PC. Please help ! STOP : INACCESSIBLE BOOT DEVICE (0x0000007B, ...) Saving Settings on Shut-Down Can't Log On to Windows win 2k network id question/reset sys info What is causing Certificate Request USB drives not recognized in "My Computer" |
|||||||||||||||||||||||