Re: Script Triggered Following a Specific System Event




<basis_consultant@xxxxxxxxxxx> wrote in message
news:476cca8e-13e3-40f8-a261-993a777069b2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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

I don't think there is such an inbuilt function. You could use the following
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 = "John@xxxxxxx"
receiver = "Jack@xxxxxxxxxxx"
subject = "Oracle failure"
body = "Oracle has shut down"
server = "mail.ISP.com"
user = "John@xxxxxxx"
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


.



Relevant Pages

  • script running under shell, has troubles with crond
    ... got a bash script that connects to a remote web server, ... this script, besides setting variables such as PATH and CLASSPATH ... runs a java application which works without any problem if run in shell. ... it tries to make a select on oracle it just hangs up with no error reported, ...
    (comp.os.linux.announce)
  • script running under shell has trouble with crond
    ... got a bash script that connects to a remote web server, ... this script, besides setting variables such as PATH and CLASSPATH ... runs a java application which works without any problem if run in shell. ... it tries to make a select on oracle it just hangs up with no error reported, ...
    (alt.os.linux)
  • [NEWS] Multiple Vulnerabilities in Oracle Database (Character Conversion, Extproc, Password Disclosu
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Multiple vulnerabilities were discovered in the (Oracle database server ... password is required to exploit this vulnerability. ...
    (Securiteam)
  • RE: Cant call method "prepare" on an undefined value
    ... The error happen on the line to connect to that database: ... This script is working fine I located the script in same server as the ... I have one oracle database located at server A and setup the Oracle ...
    (perl.dbi.users)
  • Re: How to make your report run faster
    ... I've done no work with Oracle as the Server DB, ... > if they click the listbox then "Preview report" button is enabled. ... > -I was try to make the old queries for subreport, ...
    (microsoft.public.access.reports)

Loading