/* this is a REXX script */
signal on error name getout
signal on failure name getout
signal on notready name getout
signal on error name getout
signal on halt name getout
LogPath = VALUE('LOGFILES',,'OS2ENVIRONMENT')
LogFile = LogPath'\netstat.log'
'@del /F 'LogFile' 2>&1 >NUL'
rc = stream(LogFile,'C','OPEN WRITE')
'@rxqueue /CLEAR'
say 'Press any key to end ...'
do i=1 to 10
'@netstat -m | rxqueue'
string = '********************************************************* 'Date()' *** 'Time()' ***'
rc = lineout(LogFile,string)
do j=1 to queued()
parse pull string
rc = lineout(LogFile,string)
end
if chars() > 0 then do
leave
end
'@sleep 3600s'
end
getout:
rc = stream(LogFile,'C','CLOSE')
return 0