• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to save sar reports longer than 7 days in Solaris

by admin

It might be necessary to save sar reports longer than 7 days. This post explains the steps to achieve this goal.

The “sa2” is the script that is responsible for writing a summarized daily activity report. The /usr/lib/sa/sa2 has the following entries:

#!/sbin/sh
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved

# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
# The copyright notice above does not evidence any
# actual or intended publication of such source code.

#ident "@(#)sa2.sh 1.4 98/03/26 SMI" /* SVr4.0 1.4 */
# sa2.sh 1.4 of 5/8/89
DATE=`/usr/bin/date +%d`
RPT=/var/adm/sa/sar$DATE
DFILE=/var/adm/sa/sa$DATE
ENDIR=/usr/bin
cd $ENDIR
$ENDIR/sar $* -f $DFILE > $RPT
/usr/bin/find /var/adm/sa \( -name 'sar*' -o -name 'sa*' \) -mtime +7 -exec /usr/bin/rm {} \;

The “-mtime +7” entry shows that it can only keep 7 days of sar report. Changing the value to something else will keep the record longer than 7 days.

Once done modifying the file, refresh your sar SMF service via:

# svcadm refresh svc:/system/sar:default

Filed Under: Solaris

Some more articles you might also be interested in …

  1. Resolving File System Full Situations in Solaris
  2. How to add swap file in Solaris
  3. The ultimate Solaris jumpstart troubleshooting guide
  4. Solaris : How to setup session idle timeout for ssh
  5. How to Configure a Solaris 10 Jumpstart server and client [SPARC]
  6. Solaris : How to increase the Inodes on UFS file system with newfs command
  7. How to provide unique hostid for a non global zone
  8. What are the Solaris process tools
  9. Solaris 10 boot process : x86/x64
  10. How To Change Timezone for Oracle Grid Infrastructure

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright