Article ID: 198473
Article Last Modified on 11/14/2003
148942 : How to Capture Network Traffic with Network Monitor
Name: My Test alert
Severity: 016 - Miscellaneous User Error
Error Message Contains this text: << Text of message >>
Tasks to Execute: Startup Netmon
Optional: Alert Notification Message to send to Operator: "User
Errors are occurring"
Name: Startup Netmon
Type: TSQL
Database: your_database_here
Command: exec RunNetmon
Options: Write to the Windows NT application event log on failure
NOTE: This check box is available in the New Task dialog box.
CREATE TABLE dbo.TempTime
(Sched_Time char (5) NOT NULL ,
Last_run datetime NOT NULL)
create procedure RunNetmon as -- We may only want this stored procedure to run once on demand. -- If the error occurs frequently the following stored procedure will -- only allow it to run once in a day. Otherwise, this sample will start -- multiple sessions of Netmon.exe on the server. if (select count(*) from TempTime where convert(char(8),Last_run,3) = convert(char(8),getdate(),3) ) = 0 begin print'table is empty. Inserting row...' insert into TempTime (Sched_Time, Last_run) values ( convert(char(2),datepart(hour,getdate() )) +":" + convert(char(2),datepart(minute,getdate()) +1) ,getdate() ) -- Adds 1 minute to the current time for the scheduled time. declare @mytime1 char(32) declare @mystring varchar(255) select @mytime1 = (select Sched_Time from TempTime) -- Compose the scheduled task from NT AT scheduler select @mystring = "AT " + @mytime1 + " /interactive c:\winnt\system32\netmon\netmon.exe /buffersize:15728640 /autostart" -- Load AT scheduler exec master..xp_cmdshell @mystring -- Display the current scheduled events exec master..xp_cmdshell "AT" end else print 'This stored procedure has already run today. '
Additional query words: prodsql Trigger Unable to read Login packet
Keywords: kbinfo KB198473