Specification
-- Count the number of times ""AMQ6150: WebSphere MQ semaphore is busy." is present within the AMQERR01.LOG file.
-- Report 3 if there is an increase, 2 if it is less and 1 if equal, based on the previous time the script ran versus current run as to try not to count the same instances again.
logscan.bat
findstr /c:"AMQ6150: WebSphere MQ semaphore is busy." "e:\IBM\WebSphere MQ\errors\AMQERR01.LOG"| find /c /v "" > ./tmpfile.txt
set /p error_count_new=<tmpfile.txt
del tmpfile.txt
type e:\epagent\logscan_count.txt > ./tmpfile2.txt
set /p error_count_old=<tmpfile2.txt
del tmpfile2.txt
IF %error_count_new% GTR %error_count_old% SET COUNT=3
IF %error_count_new% EQU %error_count_old% SET COUNT=1
IF %error_count_new% LSS %error_count_old% SET COUNT=2
ECHO LOGSCAN:LOG_COUNT=%COUNT%
ECHO %error_count_new% > e:/epagent/logscan_count.txt
Configuration
introscope.epagent.plugins.stateless.names=LOGSCAN
introscope.epagent.stateless.LOGSCAN.command=e:/epagent/logscan.bat
introscope.epagent.stateless.LOGSCAN.delayInSeconds=60