Capture unusual cpu and ram activity – Allied Telesis AlliedWare Plus Operating System Version 5.4.4C (x310-26FT,x310-26FP,x310-50FT,x310-50FP) User Manual
Page 2010
Triggers Configuration
Software Reference for x310 Series Switches
76.4
AlliedWare Plus
TM
Operating System - Version 5.4.4C
C613-50046-01 REV A
Capture Unusual CPU and RAM Activity
The following configuration allows you to troubleshoot high CPU or RAM usage by the
device. It uses two triggers to capture show output, and places this output in a file.
■
Trigger 3 activates the script cpu-usage.scp when CPU usage is over 90% and can
activate up to 5 times
■
Trigger 4 activates the script ram-usage.scp when RAM usage is over 95%, and can
activate up to 10 times
1.
Create the cpu-usage.scp configuration script
Create a script with the appropriate show command:
The output of the show cpu command has been redirected into a file. It is not possible
to display trigger script output on the terminal. Redirecting the command output to a
file means it is available for later inspection.
If the trigger activates on more than one occasion the contents of showcpu.txt will be
overwritten with the latest output. To keep a full record for all activations of this
trigger an ASH shell script can be added to the trigger to manage the output of the
configuration script. For example:
#!/bin/ash
date >> showcpu_bkup.txt
cat showcpu.txt >> showcpu_bkup.txt
This script concatenates that date and time of activation and the contents of
showcpu.txt onto the end of the backup file showcpu_bkup.txt in flash memory.
Note that the files may grow large accumulating data and consume available flash
memory.
2.
Create the ram-usage.scp configuration script
Create a script with the appropriate show command:
The output of the show memory command has been redirected into a file. It is not
possible to display trigger script output on the terminal. Redirecting the command
output to a file means it is available for later inspection.
If the trigger activates on more than one occasion the contents of showcpu.txt will be
overwritten with the latest output. To keep a full record for all activations of this
trigger an ASH shell script can be added to the trigger to manage the output of the
configuration script. For example:
#!/bin/ash
date >> showmem_bkup.txt
cat showmem.txt >> showmem_bkup.txt
This script concatenates that date and time of activation and the contents of
showmem.scp onto the end of the backup file showmem_bkup.scp in flash memory.
Note that the files may grow large accumulating data and consume available flash
memory.
awplus#
show cpu | redirect showcpu.txt
awplus#
show memory | redirect showmem.txt