Skip to end of metadata
Go to start of metadata


Description:

For analysis and monitoring the output of status tables and show commands is often required. In many cases it is necessary to get the output repeatedly, so that changes can be recognized.

This article describes how status tables and show commands can be read out and stored in cyclic intervals with a batch file using the tool PLINK.


Requirements:


Procedure:

In the attached batch file the following status tables are read out and show commands are executed:

  • show mem → Output of free and already used RAM
  • show job -c → Output of current jobs and their CPU load (sorted by CPU load)
  • ls /Status/xDSL/VDSL1/Advanced → Status table with VDSL sync values

The output is read out once per second and is saved to a text file with the current time. Therefore a new file is created for each query.

Batch-Info.bat

1) Dial in to your LANCOM router via PuTTY once to ensure that the SSH-Key is entered into the registry.

2) Open the attached batch script Batch-Info.bat with any desired text editor.

3. Adjust the following parameters:

  • set PLINK="C:\Program Files\PuTTY\plink.exe" → Installation path to the tool PLINK
  • set LCMS_TARGET=root@w.x.y.z → IP address of the router
  • set LCMS_TARGET_PASS=Password → Root password of the router
  • set PAUSE_TIMEOUT=1 → Time in seconds after which the commands are executed again

It is possible to add additional commands in the batch file. For that purpose the following syntax has to be used (<Name> and <command to be executed> have to be adjusted):

echo [%DATETIMEF%] <Name>
%PLINK% %LCMS_TARGET% -batch -pw %LCMS_TARGET_PASS% <command to be executed> >> %DATETIMEF%_info.txt

4) Execute the batch script via a double click to execute the commands and write the output to a text file.