Monitoring WebLogic Server Disk Usage and Deleting Logs

WebLogic Server: Disk Monitoring and Auto Delete Action

1. Below shell script shows /appdata, /root and /u01 mount points’ disk usage

#Author: Fevzi Korkutata 
#Shows server's /appdata, /ROOT and /u01 disk usage percentage 
# Modify awk part according to your server 'df' command output
echo DISK_APPDATA=$(df /appdata | grep /appdata | awk '{print $5}' | tr '%' ' ') ; echo DISK_ROOT=$(df / | grep / | awk '{print $5}' | tr '%' ' ') ; echo DISK_U01=$(df /u01 | grep /u01 | awk '{print $5}' | tr '%' ' ')

 

2. WLSDM Action Script

# Author: Fevzi Korkutata
# Finds the logs before 1 and 3 days after and deletes them
find /appdata/domains/ccb_domain/servers/. -type f -mtime +1 | grep -E 'log0|out0|err0' | awk '$1' | xargs rm -rf
find /appdata/ouaf/sploutput/CCBPROD/ -type f -mtime +3 | grep -E '*' | awk '$1' | xargs rm -rf

 

Here is the result chart after adding as Generic DevOps MBean:

WebLogic Server: Disk Monitoring and Auto Delete Action


Download WLSDM for WebLogic and try yourself!

Leave a Comment

Your email address will not be published. Required fields are marked *