[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-admin
Subject:    RE: Win32::EventLog need description
From:       "Paul Popour" <ppopour () infoave ! net>
Date:       1999-10-25 12:44:55
[Download RAW message or body]

> -----Original Message-----
> From: bounce-perl-win32-admin-55391@lyris.activestate.com
> [mailto:bounce-perl-win32-admin-55391@lyris.activestate.com]On
>  Behalf Of
> Stephen Gray
> Sent: Monday, October 25, 1999 7:48 AM
> To: Perl-Win32-Admin Mailing List
> Subject: Re: Win32::EventLog need description
>
>
> Thanks, this was a problem for me too.
>
> I have the latest version of l;anman from Jenda's page, but
> can't see any
> mention of a GetEventDescription function in the docs or the
> module. Can you
> tell me where you got your version?
>
> I have been using the Win32::EventLog::GetMessageText function but
> descriptions returned contain variable references such as
> %%1, %%2. Does
> GetEventDescription resolve these - if not do you know how to do so?
>
> Thanks for your help
>
> Steve
>

The Lanman module is available at Jenda's site as well as
http://rto.dk/packages/
=====================================
GetEventDescription($server, \%event)

Retrieves all records number in the system log on server \\testserver.
Then it reads all these events and prints out the event descriptions.

if(!Win32::Lanman::ReadEventLog("\\\\testserver", 'system', 0, -1,
\@events))
	{
	print "Sorry, something went wrong; error: ";
	print Win32::Lanman::GetLastError();
	exit 1;
	}

foreach $event(@events)
	{
	event ${$event}{'eventdescription'} = "*** Error get event description ***"
	if !Win32::Lanman::GetEventDescription("\\\\testserver"", $event);
	print ${$event}{'eventdescription'};
	}
=====================================
The some of the information is in ${$event}{'eventdescription'}, some is in
${$event}{'data'}, and some is in ${$event}{'strings'}.  Such an orderly way
of doing things.  ${$event}{'strings'} will often return a reference so you
will get something like ARRAY(01234567) instead of readable text. You can
use something like

$ref = ${$event}{'strings'};
$refcnt = 0;
undef $info;
foreach (@$ref)
	{
	$info = "$info\t$$ref[$refcnt++]";
	}

to retrieve the information from the array.  I'm sure there is some method
to the madness but I just read out the strings, data and description and
separate them with a tab.  Normally you can look at the decipher the
meaning.


---
You are currently subscribed to perl-win32-admin as: [perl-win32-admin@progressive-comp.com]
To unsubscribe, forward this message to
         leave-perl-win32-admin-90393O@lyris.activestate.com
For non-automated Mailing List support, send email to  
         ListHelp@ActiveState.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic