• 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. Solaris 10 boot process : SPARC
  2. Solaris : How to capture failed login attempts from tty logins (telnet, rlogin, and terminal)
  3. The ultimate Solaris jumpstart troubleshooting guide
  4. How to determine link status (up/down) of network interfaces in Solaris
  5. How to configure Shared Memory Parameters in Solaris 10,11
  6. How to configure a vnic on top of a Vlan Tagged Interface and assign the vnic to a Solaris 11 Zone
  7. How to measure NIC Performance/Throughput in Solaris 11 using iftop
  8. GUDS – A Script for Gathering Solaris Performance Data
  9. How to set OBP Variables from the ALOM/ILOM
  10. Solaris ZFS : How to replace a failed disk in rpool (x86)

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright