I have a script written to monitor logs and send out an SMTP mail message to
me.

Problem is - If a server has a problem on the SAME event (i.e. Symantec
Errors) I only want it to send me the message 1 time

Here is what I have thought of to fix it:

Every time an event occurs - it appends to a txt file the event id code.

Everytime it finds an error - it first checks that file to see if that event
id is in there. if it is, it skips it.

I will delete this file 1 time a day with another script to stop it from
running.

My question:

How do I code it to append something to a txt file - I know that is an easy
one

Next, how do I check it, or read it to say if its found, then skip it. else
send out the mail

Thanks in advance

Re: Event log monitoring by Michael

Michael
Fri Oct 29 19:31:20 CDT 2004

> How do I code it to append something to a txt file - I know that is
> an easy one

The FSO OpenTextFile methods 2nd argument is ued to specify reading (1),
writing (2) or appending (8).

>
> Next, how do I check it, or read it to say if its found, then skip
> it. else send out the mail

Open it and read it sequentially and check each line. If found, close up
shop and exit the script. If not found, close the file and re-open it for
appending, write to it, and close. Then send the email before exiting the
script.

--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US


Re: Event log monitoring by Mike

Mike
Mon Nov 01 07:22:28 CST 2004

Yea

That sounds all logical, however..... I am a VBA programmer w/ access - not
too familiar with VBS - any way I could get some sample code? ;-)

Thanks
mike
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:OnYKIfhvEHA.728@TK2MSFTNGP11.phx.gbl...
>> How do I code it to append something to a txt file - I know that is
>> an easy one
>
> The FSO OpenTextFile methods 2nd argument is ued to specify reading (1),
> writing (2) or appending (8).
>
>>
>> Next, how do I check it, or read it to say if its found, then skip
>> it. else send out the mail
>
> Open it and read it sequentially and check each line. If found, close up
> shop and exit the script. If not found, close the file and re-open it for
> appending, write to it, and close. Then send the email before exiting the
> script.
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
> Sammamish WA US
>



Re: Event log monitoring by Michael

Michael
Mon Nov 01 17:39:05 CST 2004

> That sounds all logical, however..... I am a VBA programmer w/ access
> - not too familiar with VBS - any way I could get some sample code?
> ;-)


WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

Google Search: opentextfile forreading group:*.scripting
http://groups.google.com/groups?q=opentextfile%20forreading%20group:*.scripting&num=100&scoring=d

Google Search: opentextfile forappending group:*.scripting
http://groups.google.com/groups?q=opentextfile%20forappending%20group:*.scripting&num=100&scoring=d

Google Search: "cdo.message" send group:*.scripting
http://groups.google.com/groups?q="cdo.message"%20send%20group:*.scripting&num=100&scoring=d


--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US