- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: Write to EventLog (lotsof points !!!)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 08:50 PM
тАО12-22-2004 08:50 PM
I'm working on script which I want to write a message to the Windows EventLog when it runs into a serious error. Is there any utility to do that, maybe in the resource kit ? Or is there a way to do it in perl. The Win32::EventLog only allows to read the Log.
Merry Xmas
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 08:59 PM
тАО12-22-2004 08:59 PM
Re: Write to EventLog (lotsof points !!!)
Check out:
http://support.microsoft.com/?kbid=154576
http://www.windowsitpro.com/WindowsScripting/Article/ArticleID/16404/16404.html
Regards,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 09:10 PM
тАО12-22-2004 09:10 PM
Re: Write to EventLog (lotsof points !!!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 09:15 PM
тАО12-22-2004 09:15 PM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 10:36 PM
тАО12-22-2004 10:36 PM
Re: Write to EventLog (lotsof points !!!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2004 02:31 AM
тАО12-23-2004 02:31 AM
Re: Write to EventLog (lotsof points !!!)
http://www.windowsitpro.com/WindowsScripting/Article/ArticleID/16404/16404.html
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2004 03:02 AM
тАО12-23-2004 03:02 AM
Re: Write to EventLog (lotsof points !!!)
But if you look closely you'll see that Gary had posted that one already. Maybe, I read it a bit in a hurry, but I don't see how I could write directly with Perl to the Windows EventLog.
I've now implemented a system call to logevent, works fine.
Cheers
Georg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2004 04:13 AM
тАО12-23-2004 04:13 AM
Re: Write to EventLog (lotsof points !!!)
use vars qw( %Log );
use strict;
use Win32::EventLog;
my %EVENT_TYPES = (
error => EVENTLOG_ERROR_TYPE,
warning => EVENTLOG_WARNING_TYPE,
info => EVENTLOG_INFORMATION_TYPE,
success => EVENTLOG_AUDIT_SUCCESS,
failure => EVENTLOG_AUDIT_FAILURE
);
foreach my $Key ( qw( Computer
Source
EventType
EventID ) )
{
$Log{$Key} = shift @ARGV;
}
$Log{Strings} = join( "\0", @ARGV );
if( my $Event = Win32::EventLog->new( $Log{Source}, $Log{Computer} ) )
{
$Log{EventType} = $EVENT_TYPES{$Log{EventType}};
if( $Event->Report( \%Log ) )
{
print "Log was successfully sent.\n";
}
else
{
print "Unable to submit log.\n";
}
$Event->Close();
}
else
{
print "Unable to connect to $Log{Computer}.\n";
}
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 06:53 PM
тАО01-05-2005 06:53 PM
Re: Write to EventLog (lotsof points !!!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2005 09:33 PM
тАО01-11-2005 09:33 PM
Re: Write to EventLog (lotsof points !!!)
Call me stupid (you probably do) but I don't see anything in that code that writes to the EventLog. I guess that's why the script is called query.pl
But, don't mind. I needed it only for some exeptionnal error handling and a system call with logevent does the job nicely.
Thanx
Georg