Network Management

Delete or move SolarWinds log files on any Orion server

This article describes how to delete or move old SolarWinds log files in your system if you experience drive space issues.

First published date

10/15/2018 1:41 PM

Last published date

11/30/2021 8:43 AM

Overview

When a customer's Orion server is running out of disk space, they can delete or move old SolarWinds Log files, and even automate log management tasks. Those actions are described in this article. 

Product section

Orion Platform

Cause

N/A

Resolution

Delete logs 

  1. Launch the command prompt as administrator
  2. Run either or both of the following commands to delete log files. 
    To remove current logs only:
    -- Scripts are not supported under any SolarWinds support program or service.
    -- Scripts are provided AS IS without warranty of any kind. SolarWinds further
    -- disclaims all warranties including, without limitation, any implied warranties
    -- of merchantability or of fitness for a particular purpose. The risk arising
    -- out of the use or performance of the scripts and documentation stays with you.
    -- In no event shall SolarWinds or anyone else involved in the creation,
    -- production, or delivery of the scripts be liable for any damages whatsoever
    -- (including, without limitation, damages for loss of business profits, business
    -- interruption, loss of business information, or other pecuniary loss) arising
    -- out of the use of or inability to use the scripts or documentation.
    
    for /f "delims=" %F in ('dir C:\ProgramData\Solarwinds /s /b ^| findstr /ie "\.log" ^| findstr /iv "RabbitMQ" ') do del /F /Q /S "%F"

    To remove old logs only:
    -- Scripts are not supported under any SolarWinds support program or service.
    -- Scripts are provided AS IS without warranty of any kind. SolarWinds further
    -- disclaims all warranties including, without limitation, any implied warranties
    -- of merchantability or of fitness for a particular purpose. The risk arising
    -- out of the use or performance of the scripts and documentation stays with you.
    -- In no event shall SolarWinds or anyone else involved in the creation,
    -- production, or delivery of the scripts be liable for any damages whatsoever
    -- (including, without limitation, damages for loss of business profits, business
    -- interruption, loss of business information, or other pecuniary loss) arising
    -- out of the use of or inability to use the scripts or documentation.
    
    for /f "delims=" %F in ('dir C:\ProgramData\Solarwinds /s /b ^| findstr /ie "\.log\..*" ') do del /F /Q /S "%F"

 

Move logs 

  1. Launch the command prompt as administrator
  2. Run either or both of the following commands to move log files.
    To move current logs only:
    -- Scripts are not supported under any SolarWinds support program or service.
    -- Scripts are provided AS IS without warranty of any kind. SolarWinds further
    -- disclaims all warranties including, without limitation, any implied warranties
    -- of merchantability or of fitness for a particular purpose. The risk arising
    -- out of the use or performance of the scripts and documentation stays with you.
    -- In no event shall SolarWinds or anyone else involved in the creation,
    -- production, or delivery of the scripts be liable for any damages whatsoever
    -- (including, without limitation, damages for loss of business profits, business
    -- interruption, loss of business information, or other pecuniary loss) arising
    -- out of the use of or inability to use the scripts or documentation.
    
    robocopy C:\ProgramData\Solarwinds C:\destination_folder *.log /XD RabbitMQ /S /MOV

    To move old logs only:
    -- Scripts are not supported under any SolarWinds support program or service.
    -- Scripts are provided AS IS without warranty of any kind. SolarWinds further
    -- disclaims all warranties including, without limitation, any implied warranties
    -- of merchantability or of fitness for a particular purpose. The risk arising
    -- out of the use or performance of the scripts and documentation stays with you.
    -- In no event shall SolarWinds or anyone else involved in the creation,
    -- production, or delivery of the scripts be liable for any damages whatsoever
    -- (including, without limitation, damages for loss of business profits, business
    -- interruption, loss of business information, or other pecuniary loss) arising
    -- out of the use of or inability to use the scripts or documentation.
    
    robocopy C:\ProgramData\Solarwinds C:\destination_folder *.log.* /XF *.log /S /MOV


Automate log management tasks 

  1. Open the task scheduler as an administrator.
  2. Create a new Basic Task.
  3. Enter the name of the task, and create a schedule.
  4. Choose Start a program, and browse for C:\Windows\System32\cmd.exe.
  5. In the Add arguments field, enter one of the commands from Delete logs or Move logs section.
  6. Complete the wizard.