Last active
November 23, 2018 08:48
-
-
Save elpatron68/40403bea79453e17a2f4822abd9f2986 to your computer and use it in GitHub Desktop.
Monitor LANCOM Memory And Heap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SETLOCAL | |
set PLINK="C:\Program Files (x86)\PuTTY\plink.exe" | |
set LCMS_TARGET=root@X.Y.Z.A | |
set LCMS_TARGET_PASS= | |
set PAUSE_TIMEOUT=60 | |
:START | |
FOR /F "skip=1" %%D IN ('WMIC OS GET LocalDateTime') DO ( SET LDATE=%%D & GOTO GOT_LDATE ) | |
:GOT_LDATE | |
SET DATETIMEF=%LDATE:~0,4%-%LDATE:~4,2%-%LDATE:~6,2%_%LDATE:~8,2%-%LDATE:~10,2%-%LDATE:~12,2% | |
echo [%DATETIMEF%] show mem | |
%PLINK% %LCMS_TARGET% -batch -pw %LCMS_TARGET_PASS% show mem >> %DATETIMEF%_memoryinfo.txt | |
echo [%DATETIMEF%] show heap -v | |
%PLINK% %LCMS_TARGET% -batch -pw %LCMS_TARGET_PASS% show heap -v >> %DATETIMEF%_memoryinfo.txt | |
echo [%DATETIMEF%] waiting %PAUSE_TIMEOUT% sec | |
TIMEOUT /T %PAUSE_TIMEOUT% /NOBREAK > NUL | |
GOTO START | |
ENDLOCAL | |
@echo on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment