Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 09:16 PM
Virgo_guy
Guest
 
Posts: n/a
Default Event Log Collector - for the Event Viewer - to collect events into a database - How to?

Hi I am perplexed, I feel hopeless, I hope that someone can help me
with a problem. I have Visual Basic .NET

I want to develop an Event Collector. That will collect all events
from the Local computer or maybe 2 computers; (1 local and 1 remote) -

Collecting the Event Viewers Logs but only the system and application
logs and then put them into a Access database as a table, so that I
can run Querys on the events, such as:

Assuming both computers had several Event Id 2003's with Event Source
Perflib.

I want 2 input boxes that I can input the Event Id, and the Source and
then run querys to see what times they occured and on what computers
they occured on.

I want to expand on this concept later by adding more computers and
more tables, and different types of queries, but for right now I just
need to know how to do this small scale
(just for the local computer and maybe one remote computer.)

This will get me started and I think I can figure out the rest.

Please help me get out of this rut. Thanks for any advice or help no
matter what it is I am sure it will help and I can get something out
of it.

Thanks again! ~N.
  #2  
Old July 17th, 2005, 09:30 PM
Crazy_Rick
Guest
 
Posts: n/a
Default Re: Event Log Collector - for the Event Viewer - to collect events into a database - How to?

I'm trying to do the same at the moment with a .vbs Script, however it
fails once i try to collect logfiles from a remote machine. A Computer
name instead the "." in strComputer seems to connect to the computer,
however the proceedure only works for my own hostname. I guess this
might be a permission problem.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where LogFileName='System'")
For Each objLogfile in colLogFiles
errBackupLog = objLogFile.BackupEventLog("c:\scripts\System.evt")
If errBackupLog <> 0 Then
Wscript.Echo "The System event log could not be backed up."
End If
Next

Thomas
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles