How to step up SSL log transfer - Windows


1)  Write the log capturing script:  See Appendix A
2)  Write a SFTP Batch script:  See Appendix B:
3)  Make\Add a Service account to the Administrator Folder
4)  Login as Service account
5)  Add the following route to the Data out NIC (route add –p 10.225.3.73 XXX.XXX.XXX.XXX)
6)  Place the Log capturing script in a non-temporary location
7)  Set up Scheduled Task to run the Capturing Script
8)  Refresh the SSL\SFTP user account (see example)
    Example:     d:\cygwin\bin\mkgroup -l >..\etc\group
d:\cygwin\bin\mkpasswd -l >..\etc\passwd
Net Stop "CYGWIN SSHD"
Net Start "CYGWIN SSHD"
This shows that the Cygwin directory is located on the D: drive – check your location first
9)   Make a SFTP Key to exchange with the SFTP server.  Use the following command
        d:\cygwin\bin\ssh-keygen -t rsa
10) Pass the SFTP Key to the SFTP server administrator
11) Test the Scheduled Task
12) Log into the server and check the data sent.

Appendix A:

ECHO ******DLU Log File Collection******
ECHO ***DELETE OLD Files***
C:
CD C:\temp\BatchLogSFTP
DEL *.* /Q

Cd C:\temp\BatchLogSFTP
for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set tdtd=%%k%%i%%j
mkdir %tdtd%
cd %tdtd%

mkdir WebSphere
mkdir BBW
mkdir BlueDragon
mkdir Link_B
mkdir Link_C
mkdir Link_D

robocopy "D:\Program Files\ibm\WebSphere\AppServer\profiles\AppSrv01\logs\Clone1" C:\temp\BatchLogSFTP\%tdtd%\WebSphere *.* /MAXAGE:%tdtd% /R:1
robocopy D:\bbw\logs C:\temp\BatchLogSFTP\%tdtd%\BBW *.* /MAXAGE:%tdtd% /R:1
robocopy "D:\Program Files\WebSphere\AppServer\installedApps\DLB-BCCAPP1Network\Magnet Biz Banking Works with BlueDragon.ear\bbwcfweb.war\WEB-INF\bluedragon\work\temp\rtelogs" C:\temp\BatchLogSFTP\%tdtd%\BlueDragon *.* /MAXAGE:%tdtd% /R:1
robocopy D:\WireLinkMQ\Link_B\logs C:\temp\BatchLogSFTP\%tdtd%\Link_B *.* /MAXAGE:%tdtd% /R:1
robocopy D:\WireLinkMQ\Link_C\logs C:\temp\BatchLogSFTP\%tdtd%\Link_C *.* /MAXAGE:%tdtd% /R:1
robocopy D:\WireLinkMQ\Link_D\logs C:\temp\BatchLogSFTP\%tdtd%\Link_D *.* /MAXAGE:%tdtd% /R:1

psloglist -s -h 24 Application > C:\temp\BatchLogSFTP\%tdtd%\AppEvtLog%tdtd%.csv
REM psloglist -s -h 24 Security > C:\temp\BatchLogSFTP\%tdtd%\Securitylog%tdtd%.csv
psloglist -s -h 24 System > C:\temp\BatchLogSFTP\%tdtd%\Systemlog%tdtd%.csv
psloglist -s -h 24 "operations Manager" > C:\temp\BatchLogSFTP\%tdtd%\OpsMgrEvtLog%TDTD%.csv
cd ..
wzzip -a -r -p -ex DLU_App1_%tdtd%_logfiles.zip C:\temp\BatchLogSFTP\%tdtd%
rmdir /S /Q %tdtd%

d:\cygwin\bin\sftp -b D:\AutoLogTrans\SFTPLogs.bat sftpuser@10.225.3.73

Appendix B:

lcd C:\temp\BatchLogSFTP\
cd /opt/IBM/HTTPServer/logdir/logfiles/DLU
put *.zip
exit

Post a Comment

Previous Post Next Post