Glen Holcomb
11/13/2007 10:37:00 PM
On Nov 13, 2007 3:04 PM, Brian Scott <cuiguy@network32.net> wrote:
> Hello,
>
> Anyone know a way to read Window eventlogs remotely and add them to a
> mysql database for a webpage to create reports from?
>
>
> I have looked at Win32-event & win32-eventlog and with no luck so far.
>
>
You should be able to do it with WMI. Without doing some research I'm
not sure exactly how though.
The following code runs without error but I have no idea what the
structure of the returned object is so have no way of knowing how to
drill into it for useful data:
wmi = WIN32OLE.connect("winmgmts:\\\\" + machinename + "\\root\\cimv2")
wmi.ExecQuery("Select * from Win32_NTLogEvent Where Logfile = 'Application'")
To be honest I'm not sure this is working properly, WMI can be pretty
crappy about feedback, from my experience. The last time I used this,
I was creating home directories on remote machines when people
requested accounts, I had to do a lot of trial and error. I'm not a
Windows guy either though.
--
"Hey brother Christian with your high and mighty errand, Your actions
speak so loud, I can't hear a word you're saying."
-Greg Graffin (Bad Religion)