|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 7:10 AM
Points: 485,
Visits: 1,568
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:15 AM
Points: 123,
Visits: 502
|
|
the only thing that i whould change, is running the vbs from windows schedule task and not from the sql server, i think it's more correct way. This will give you the ability prepare a vbs that you can put on all of you server's, rather only in the db server (although you can query the event viewer of a remote server, which is little more work).
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, March 15, 2013 1:34 PM
Points: 27,
Visits: 182
|
|
Hello,
your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?
Thanks a lot
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 7:10 AM
Points: 485,
Visits: 1,568
|
|
renasoursou (11/8/2010) Hello,
your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?
Thanks a lot
Do you have SQL running with a database called DBA on your server? does the database DBA have the table EventLogStaging?
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 7:10 AM
Points: 485,
Visits: 1,568
|
|
peleg (11/8/2010) the only thing that i whould change, is running the vbs from windows schedule task and not from the sql server, i think it's more correct way. This will give you the ability prepare a vbs that you can put on all of you server's, rather only in the db server (although you can query the event viewer of a remote server, which is little more work).
yes, you could use windows scheduler, however, since the DB is required to make it work, the script would have to include some logic to handle itself if the DB was not avaialble. it is also designed to be used by a DBA. in some places, DBA's do not have access to the windows scheduler.
also, the script is only required on one server
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:15 AM
Points: 123,
Visits: 502
|
|
since the DB is required to make it work, the script would have to include some logic to handle itself if the DB was not avaialble.
this logic should run from the vbscript.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:15 AM
Points: 123,
Visits: 502
|
|
| the problem that newbie got, isn't related to the DB, rather to the query of the wmi object.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, March 15, 2013 1:34 PM
Points: 27,
Visits: 182
|
|
Geoff A (11/8/2010)
renasoursou (11/8/2010) Hello,
your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?
Thanks a lot
Do you have SQL running with a database called DBA on your server? does the database DBA have the table EventLogStaging?
Yes I have. On thIs Server there are running an 2000 Sql Server and a 2005 SQL Server Instance. I have changed this Line
--> objConn.Open "Provider=SQLOLEDB.1;Data Source=RLDB2,4949\RLDB2_05;Initial Catalog=DBA;Integrated Security=SSPI"
RLDB2,4949\RLDB2_05 --> This is our SQL Server 2005 Instance on this Server.
I dont understand this error...
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:15 AM
Points: 123,
Visits: 502
|
|
you have problem with the WMI object, not with the DB. what did you change with the code?
query = "Select * from __InstanceCreationEvent" _ & " " & "where TargetInstance isa 'Win32_NTLogEvent'" _ & " " & "and TargetInstance.Logfile = 'Application'" _ & " " & "and (TargetInstance.EventType = 1 or TargetInstance.EventType = 2)" _ & " " & "and (TargetInstance.SourceName like 'MSSQL%')" ' get ready to insert into our DBA table
the problem is when you try to run the query :
Set colMonitoredEvents = objWMIService.ExecNotificationQuery(query)
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 7:10 AM
Points: 485,
Visits: 1,568
|
|
renasoursou, try this;
create an alias for RLDB2,4949\RLDB2_05 and call it something like "monitor"
then change Data Source=RLDB2,4949\RLDB2_05 to Data Source=monitor
|
|
|
|