'Basic Oracle Script 'Written by Tim Schreyack 'You must set up the Oracle driver in Data Sources (ODBC) (in the Control Panel) using the Microsoft ODBC for Oracle driver 'Server name in ODBC refers to the IP/DNS Name for the server that hosts the Oracle database. 'You must also install the Oracle driver for Windows and configure TNSNAMES.ORA with the instance you are connecting to. 'Enter log message to the WhatsUp Event Viewer Context.LogMessage "Checking Address=" & Context.GetProperty("Address") 'Set the result code of the check to Success by default (0=Success, 1=Error) Context.SetResult 0, "OK" 'Declare constant values Const adOpenStatic = 3 Const adLockOptimistic = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordset = CreateObject("ADODB.Recordset") 'Set up connection to database objConnection.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=serverinstance name as configured in tnsnames.ora;Uid=username;Pwd=password;" objConnection.Open 'Query to run objRecordset.Open "SELECT something FROM table WHERE criteria", objConnection, adOpenStatic, adLockOptimistic 'If statement to set the error state. If objRecordset.recordcount >= 1 Then Context.SetResult 1, "Error" End If Context.LogMessage Results objRecordset.Close objConnection.Close set objRecordset=nothing set objConnection=nothing