PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Windows Event Logging
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Windows Event Logging

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 23h04   #1
Brian Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Windows Event Logging

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.

  Réponse avec citation
Vieux 13/11/2007, 23h32   #2
F. Senault
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Windows Event Logging

Le 13 novembre 2007 à 23:04, Brian Scott a écrit :

> I have looked at Win32-event & win32-eventlog and with no luck so far.


Microsoft gives away a tool called logparser [1], which exports an
eventlog to CSV or XML. From there, you can slurp the file and analyze
it with ruby.

Of course, you need to run it from a windows box (or maybe with another
OS, wine, and a good dose of luck).

Fred
[1] : http://www.microsoft.com/technet/scr...r/default.mspx
--
People like us Know how to survive There's no point in living
If you can't feel the life We know when to kiss
And we know when to kill If we can't have it all Then nobody will
(Garbage, The World Is Not Enough)
  Réponse avec citation
Vieux 13/11/2007, 23h36   #3
Glen Holcomb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Windows Event Logging

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)

  Réponse avec citation
Vieux 13/11/2007, 23h45   #4
Daniel Berger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Windows Event Logging

On Nov 13, 3:04 pm, Brian Scott <cui...@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 want win32-eventlog. As per the docs, you specify the remote host
name as the second argument to EventLog.new:

require 'win32/eventlog'
include Win32

# Replace 'Application' with whatever event source you want
EventLog.new('Application', some_host) do |log|
p log
end

Putting the event log descriptions into a MySQL database is something
you'll have to do on your own.

Regards,

Dan


  Réponse avec citation
Vieux 15/11/2007, 14h10   #5
Peña, Botp
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Windows Event Logging

From: Brian Scott [mailto:cuiguy@network32.net]=20
# Anyone know a way to read Window eventlogs remotely and add=20
# them to a =20
# mysql database for a webpage to create reports from?
#=20
# I have looked at Win32-event & win32-eventlog and with no luck so far.

what is wrong w win32-eventlog?
you can even do realtime monitor w it using eventlog#tail or =
evenlog#change_notify...

kind regards -botp

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h24.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,41643 seconds with 13 queries