Logging to system event logs... 
Author Message
 Logging to system event logs...

Hi Everyone,

I am new to the world of VB and have hit a stumbling
block.  I have developed a script that so far,

1. retrieves the text from a URL
2. loads this in to a string
3. looks for a specific word within that string
4. if the word exists, outputs a message to the screen.

What I need to do on step 4 is to generate an event in the
windows 2000 application log.  The reason for this is that
I am using the script to check for failures within the web
sites that I have running and if one of the servers fails,
generate an event.  I then have a monitoring tool that is
monitoring the Win2K application log, this tool will pick
up on the failed event and e-mail me.

All I am missing is that last step in the process.

Any help is greatly appreciated.

Aaron Townsend



Wed, 29 Dec 2004 00:20:54 GMT  
 Logging to system event logs...
Will the application log do?
From http://msdn.microsoft.com/library/en-us/script56/html/wsmthlogevent.asp

Set WshShell = WScript.CreateObject("WScript.Shell")
rc = runLoginScript()      'Returns true if logon succeeds.

if rc then
   WshShell.LogEvent 0, "Logon Script Completed Successfully"
else
   WshShell.LogEvent 1, "Logon Script failed"
end if

Regards,
Ian
WSH FAQ http://groups.msn.com/windowsscript


Quote:
> Hi Everyone,

> I am new to the world of VB and have hit a stumbling
> block.  I have developed a script that so far,

> 1. retrieves the text from a URL
> 2. loads this in to a string
> 3. looks for a specific word within that string
> 4. if the word exists, outputs a message to the screen.

> What I need to do on step 4 is to generate an event in the
> windows 2000 application log.  The reason for this is that
> I am using the script to check for failures within the web
> sites that I have running and if one of the servers fails,
> generate an event.  I then have a monitoring tool that is
> monitoring the Win2K application log, this tool will pick
> up on the failed event and e-mail me.

> All I am missing is that last step in the process.

> Any help is greatly appreciated.

> Aaron Townsend



Wed, 29 Dec 2004 05:51:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help: Event Logging to System log

2. Logging events to NT Event Log from VB5

3. Making an Event Log Message File in VB (NOT WRITING TO THE EVENT LOG)

4. Event Log: Writing to the NT Event Log

5. Write in the application log or system log

6. Write in Application Log or System Log on NT

7. Logging events using app.log

8. Logging to the Event Log

9. Logging to WINNT event log

10. How-to: Log to NT Event Log

11. System event logs

12. Recording Last system event log into excel

 

 
Powered by phpBB® Forum Software