ADC

How to free space on /var directory for logging issues with a Citrix ADC appliance

The following article explains how an administrator can free the space from the /var directory of a Citrix ADC appliance. You can follow the steps when the Citrix GUI is not accessible.

When the amount of disk space is low in the /var directory of the appliance, you might not be able to sign in to the Citrix GUI. In this scenario, you can remove the old log files to create free space in the /var directory.

Points to remember

  • Ensure that you back up the files before removing the files from the appliance.

To free space in the /var directory of a Citrix ADC appliance, complete the following procedure:

  1. Log on to the CLI of Citrix ADC by using SSH. For more information to complete this task, see the Citrix ADC documentation.
  2. After you log on to Citrix ADC CLI, switch to the shell prompt using the following command.shell
  3. Run the following command to see the availability of space on the Citrix ADC appliance.df -h
  4. If the memory capacity of the /var directory is filled up to 90 percent, then you must delete few files from this directory.

    • Run the following commands to view the contents of the /var directory: cd /var ls -l

    The directories that are usually of interest are as follows:

    /var/nstrace - This directory contains trace files.This is the most common reason for HDD being filled on the Citrix ADC. This is due to an nstrace being left running for indefinite amount of time. All traces that are not of interest can and should be deleted. To stop an nstrace, go back to the CLI and issue stop nstrace command.
    
    /var/log - This directory contains system specific log files.
    
    /var/nslog - This directory contains Citrix ADC log files.
    
    /var/tmp/support - This directory contains technical support files, also known as, support bundles. All files not of interest should be deleted.
    
    /var/core - Core dumps are stored in this directory. There will be directories within this directory and they will be labeled with numbers starting with 1. These files can be quite large in size. Clear all files unless the core dumps are recent and investigation is required.
    
    /var/crash - Crash files, such as process crashes are stored in this directory. Clear all files unless the crashes are recent and investigation is required.
    
    /var/nsinstall -  Firmware is placed in this directory when upgrading. Clear all files, except the firmware that is currently being used.
    
    • Verify if any of the directories are using more space:

      du -hs *
      44k    cache
      2.0k    clusterd
      2.0k    configdb
      6.0k    core
      989M    crash
      4.0k    cron
      2.0k    dev
      6.0k    download
      2.0k    gui
      2.0k    install
      2.0k    krb
      2.0k    learnt_data
      122M    log
      366M    netscaler
      14k    ns_gui
      86k    ns_sys_backup
      631M    nsinstall
      883M    nslog
      32k    nsproflog
      2.0k    nssynclog
      16k    nstemplates
      36k    nstmp
      4.5G    nstrace
      8.1M    opt
      6.0k    pubkey
      52k    run
      28M    safenet
      72M    tmp
      2.0k    vmtools
      14k    vpn
      
  • Delete the files which are not required:

     rm -r nstrace/*
    

    For more help on deleting files see FreeBSD man Pages.

    • If the log or nslog directory is using more space, then run the following commands to open the log directory and view its contents:
    • Delete the files which are not required. rm -r nstrace/* For more help on deleting files see FreeBSD man Pages.
    • If the log or nslog directory is using more space, then run the following commands to open the log directory and view its contents:

       cd /var/log
       ls -l
       cd /var/nslog
       ls -l
      
  1. Ensure that all files are compressed. This is indicated by the .tar.gz file name extension.
  2. If you are using Citrix ADM, then verify the /var/ns_system_backup directory. Ensure that Citrix ADM clears the backup files it creates.

More resources

For information on any of the commands mentioned in the preceding procedure, see - http://ss64.com/bash/

How to free space on /var directory for logging issues with a Citrix ADC appliance