NT Event Logs
by "Charlton, Mark" <Mark.Charlton(at)saint-gobain.com>
|
| Date: |
Tue, 8 May 2001 11:00:00 -0400 |
| To: |
"'hwg-languages(at)hwg.org'" <hwg-languages(at)hwg.org> |
| |
todo: View
Thread,
Original
|
|
Last month I go this perl script via HWG to back up my NT event logs, and I
have been trying to use it, however when I run it I have to run it twice to
get it to output all the NT event logs. I run it the first time and it
given me the system and security logs. the second time I run it I get the
application log output, but the first 2 output logs are not altered.
Does anyone have any ideas why, or how I can fix this?
The other problem is that when I schedule it it doesn't run at all. I have
created an NT user for the task, but cannot determine what permissions it
requires for it to run the perl code. The user has RX access to the entire
perl install directory and change to the script directory.
#!/usr/bin/perl
use Win32::EventLog;
use Time::CTime;
use strict;
my ($Event, @timearray, $filename,
$day, $month);
for ('System', 'Security', 'Application') {
$Event = new Win32::EventLog ("$_", "");
@timearray=localtime(time);
$month = sprintf ('%.2d', $timearray[4]);
$day = sprintf ('%.2d', $timearray[3]);
$filename = 'c:/EventLogs/' . ($timearray[5]+1900) . '_' .
$month . '_' . $day . '_' . $_ . '.events';
$Event->Clear($filename);
`gzip -9 $filename`;
} # End for
I know I really need to learn perl if I want to use this, but unfortunatelly
as with the rest of the world, the ideal method, is often one of the many
that are unavailable!
Thanks for any help
Mark
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.