Description

This article provides a work-around for correcting the error condition.

Symptoms

- Application visibility page will get stuck and we will need to wait for 15-20 minutes for app-visibility data to be shown over SD UI
- After 24 hours records will not move from ApplicationStatisticsHourly to ApplicationStatistics table under appvisibility_db
- Application Visibility based data/reports are not working

Solution

Note: Root cause is due to large amount of records/data are getting stored under ApplicationStatisticsHourly table and data is not moving from ApplicationStatisticsHourly to ApplicationStatistics table under appvisibility_db

 

Workaround: 

Run the attached scripts to clean up records under ApplicationStatisticsHourly and ApplicationStatistics table. Contact JTAC with any questions or assistance using this script. 

 

Note: This script is designed for use with Security Director 21.1 and Later release. Use this script only when Application Visibility based data/reports are not working. 
 

  1. Make a backup of the Space database by following the steps in Backing Up the Junos Space Network Management Platform Database .
  2. Download script file ApplicationVisibility_DataReduction_sh.zip

  3. SCP the script file to the server and unzip.  (Unzip the script on the server to ensure file integrity). 

    Example:
    # cd /home/admin/
    # unzip ApplicationVisibility_DataReduction_sh.zip 
    # chmod +x ApplicationStatisticsHourly_DataReduction.sh  ApplicationStatistics_DataReduction.sh
    
  4. Need to modify both script using vi editor based on requirement to keep the older data. 

    # vi ApplicationStatisticsHourly_DataReduction.sh 
    # vi ApplicationStatistics_DataReduction.sh 
    
    Example:
    DAYS_IN_SECONDS_7=604800000
    DAYS_IN_SECONDS_14=1209600000
    DAYS_IN_SECONDS_21=1814400000
    DAYS_IN_SECONDS_30=2592000000
    
    # MODIFY HERE if needed: Replace Variable in next line for selected time
    SELECTED_DAYS=$DAYS_IN_SECONDS_21
    
  5. Run both the script to purge the older records and script execution may take some time depending on the number of older records : 
    # sh ApplicationStatisticsHourly_DataReduction.sh 
    # sh ApplicationStatistics_DataReduction.sh
  6. You can also define this under crontab to purge the older records using above purging script on daily basis (Ex. In every 24 hours it will delete the records older then the selected no of days)

     

Note : If you face any issues, please contact JUNIPER JTAC Support for assistance.

Modification History

2024-04-05 : Article Created