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
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