Strange Chars on LogParser 2.2 output - EVT --> NAT

K

KayZer Soze

I do a script to collect erros in eventviewer and send by mail
When there's no errors, i receve by mail, strange chars:

in the mail body i receive:

-------- BEGIN ---------
`?%

-------- END ---------

the Script

@echo off
cls
; REM ********************
; rem *** VERSAO 3.0.0 ***
; REM ********************
set SMTPSERVER=192.168.110.38
set PARAMS=-i:EVT -o:NAT -rtp:-1 -stats:OFF
set [email protected]
set SERVER1=srv-producao01
set SERVER2=srv-desenv
echo.
echo.
"C:\Program Files\Log Parser 2.2\logparser"
%PARAMS% -iCheckpoint:C:\temp\errsysprod.lpc "SELECT DISTINCT SourceName,
Message FROM \\%SERVER1%\System WHERE EventType=1" > c:\temp\errsysprod.log
"C:\Program Files\Log Parser 2.2\logparser"
%PARAMS% -iCheckpoint:C:\temp\errsysdes.lpc "SELECT DISTINCT SourceName,
Message FROM \\%SERVER2%\System WHERE EventType=1" > c:\temp\errsysdes.log
"C:\Program Files\Log Parser 2.2\logparser"
%PARAMS% -iCheckpoint:C:\temp\errappprod.lpc "SELECT DISTINCT SourceName,
Message FROM \\%SERVER1%\Application WHERE EventType=1" >
c:\temp\errappprod.log
"C:\Program Files\Log Parser 2.2\logparser"
%PARAMS% -iCheckpoint:C:\temp\errappdes.lpc "SELECT DISTINCT SourceName,
Message FROM \\%SERVER2%\Application WHERE EventType=1" >
c:\temp\errappdes.log

echo.
echo.
postie -host:%SMTPSERVER% -from:ERROR_SYS_LOG_PROD%DESTDOMAIN -to:borup%DEST
DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errsysprod.log
postie -host:%SMTPSERVER% -from:ERROR_SYS_LOG_DES%DESTDOMAIN% -to:borup%DEST
DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errsysdes.log
postie -host:%SMTPSERVER% -from:ERROR_APP_LOG_PROD%DESTDOMAIN% -to:borup%DES
TDOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errappprod.lo
g
postie -host:%SMTPSERVER% -from:ERROR_APP_LOG_DES%DESTDOMAIN% -to:borup%DEST
DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errappdes.log
 
M

Michael Bednarek

I do a script to collect erros in eventviewer and send by mail
When there's no errors, i receve by mail, strange chars:

Do the files c:\temp\errsysprod.log, c:\temp\errsysdes.log, etc, exist
if no errors occurred? If so, what's their content?

[snip]
postie -host:%SMTPSERVER% -from:ERROR_SYS_LOG_PROD%DESTDOMAIN -to:borup%DEST
DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errsysprod.log
[snip]
 
K

KayZer Soze

The files on the first time, does not exist, but the script run several
times and erros is occurring again and again.

I can try to delete temp files on exit


Michael Bednarek said:
I do a script to collect erros in eventviewer and send by mail
When there's no errors, i receve by mail, strange chars:

Do the files c:\temp\errsysprod.log, c:\temp\errsysdes.log, etc, exist
if no errors occurred? If so, what's their content?

[snip]

postie -host:%SMTPSERVER% -from:ERROR_SYS_LOG_PROD%DESTDOMAIN -to:borup%DES T

DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errsysprod.lo g
[snip]
 
M

Michael Bednarek

The files on the first time, does not exist, but the script run several
times and erros is occurring again and again.

I don't quite follow. What errors? In your original post you mentioned
some unexpected content in the body of the receive e-mails. If you
observe errors, please quote the text.

Also: do the commands ever produce the output you expect, or do they
always fail/produce unexpected output? As I wrote before: when they
fail, what's the content of the .log files?

My question aimed at the condition when the file mentioned as -file in
the "postie" command doesn't exist. To be safe, you could start your
script with:
ECHO This is my error log:>c:\temp\errsysdes.log
for each kind of .log file, and then replace all single redirection
symbols (>) in the "logparser" command with double ones (>>).
I can try to delete temp files on exit


Michael Bednarek said:
I do a script to collect erros in eventviewer and send by mail
When there's no errors, i receve by mail, strange chars:

Do the files c:\temp\errsysprod.log, c:\temp\errsysdes.log, etc, exist
if no errors occurred? If so, what's their content?

[snip]

postie -host:%SMTPSERVER% -from:ERROR_SYS_LOG_PROD%DESTDOMAIN -to:borup%DES T

DOMAIN% -cc:rviana%DESTDOMAIN% -s:%DATE%-%TIME% -file:c:\temp\errsysprod.lo g
[snip]
 
Top