Wireless Controller
Dedicated Wi-Fi control and management for high density and mobility
nmichael
Staff
Staff
Article Id 197825

Description

 

This article explains how to clear flash logs on all the APs which helps gather a fresh set of AP logs. 


Scope:

 

FortiWLC.

 

Solution

 

The Access point’s flash logs may contain stale information which may not be necessary while troubleshooting. Often, they may confuse us with too many information if we are looking for a particular problem.

 

The command used to erase the flash log memory is:

 

ap> file areaerase logk0

ap> file areaerase logk1

 

The above commands have to be entered on the AP prompt. It is not feasible to enter the above commands on all the APs in a large network.

Follow the below procedure to clear the flash logs on all the APs connected to a controller.

 

Note:

All the APs have to be rebooted once for this to take effect. 

 

Procedure:

  1. Create a notepad file with the below contents and save it with a file extension '.scr:

 

file areaerase logk0

file areaerase logk1

 

For example, let’s name the file as 'clear-flash.scr'.

 

  1. Login to the CLI interface of the controller.
  2. Go to the directory ATS/Scripts by entering the below command:

 

#cd ATS/scripts

 

  1. Upload the flasherase.scr file to the controller using ftp or tftp. The CLI commands are:

 

#copy ftp://anonymous:anonymous@<FTP server ip address>/clear-flash.scr .

#copy tftp://<TFTP server ip address>/clear-flash.scr .

 

  1. Once done, find it under 'dir' output.
  2. Type the below command for the script to take effect:

 

Fortiwlc(15)# configure terminal

Fortiwlc(15)(config)# boot-script clear-flash.scr 

 

 

  1. Verify under 'show controller' to see what script is in use.
  2. Reboot the APs and wait for the APs to come up.
  3. When all the APs are online go ahead and remove the boot script using the command:

 

Fortiwlc(15)# configure terminal

Fortiwlc(15)(config)# no boot-script

 

To perform the above through the web Interface: 

 

Step 1: Navigate to Maintenance -> AP Init Script -> New. Add any name (for example clear-flash) and enter the below commands, and select 'Save'.

 

file areaerase logk0
file areaerase logk1

 

 

1-Add boot script.png

 

Step 2: Mapping the script as a boot script in controller: Navigate to Configuration -> Devices -> Controller -> Under 'Default AP Init Script, add the newly created script name 'clear-flash.scr and select 'Save'. To take effect, reboot all the APs.

 

2- boot script in controller.png

 

Step 3: Mapping it to required APsIf the script needs to be applied on all APs, map it in the controller and reboot the APs under Configuration -> Devices -> APs, select required APs or all APs,select Bulk Update', select the option 'AP-Init-script, enter the created script name 'clear-flash.scr' and select OK.

 

2- Bulk Update.png

 

3- Map the script.png

 

  • Reload all the APs or required APs so that the script content will be applied.
  • Once the AP is back online, connect to the AP and verify if flashlogs have been cleared.

 

Fortiwlc(15)# conn ap 2
ap-2> flashcmds show all ==> The output should be empty

 

 

Note:

 Mapping the script as a boot script will clear flash logs from all APs; when either the controller is rebooted or any of the APs is rebooted.

The script needs to be added only if the plan is to capture fresh logs for debugging and to be unmapped once testing is done.