Event Log Collector - for the Event Viewer - to collect events into a database - How to?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Virgo_guy

    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.
  • Crazy_Rick

    #2
    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("winm gmts:" _
    & "{impersonation Level=impersona te,(Backup)}!\\ " & _
    strComputer & "\root\cimv 2")
    Set colLogFiles = objWMIService.E xecQuery _
    ("Select * from Win32_NTEventLo gFile where LogFileName='Sy stem'")
    For Each objLogfile in colLogFiles
    errBackupLog = objLogFile.Back upEventLog("c:\ scripts\System. evt")
    If errBackupLog <> 0 Then
    Wscript.Echo "The System event log could not be backed up."
    End If
    Next

    Thomas

    Comment

    Working...