#!/bin/sh
#
# description: The sysstat utilities are a collection of performance 
#	monitoring tools for Linux. These include mpstat, iostat, sar and 
# 	sa tools.
#
# chkconfig: 2345 60 60
#
# Author: Klaus.Franken@fth2.siemens.de
# Die Okt 12 10:05:41 EDT 1999
#
# Modified by:
# 1999/11/07 - Sebastien Godard <sebastien.godard@wanadoo.fr>
#	Now use '-d' option when starting sar.
# 2000/01/22 - Sebastien Godard <sebastien.godard@wanadoo.fr>
#	Rewritten from scratch. Call sadc instead of sar.
# 2000/11/28 - W.Bosse <wbosse@snafu.de>
#       Adapted for RH's chkconfig/logging. Create report during shutdown.
#
# /etc/rc.d/init.d/sysstat

. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
        msg="Setup system activity data collector (sadc): "
	echo -n $msg
        /usr/lib/sa/sadc -
	success "$msg"
        echo
	touch /var/lock/subsys/sysstat
        ;;
  stop) msg="Generate system activity report (sar): "
	echo -n $msg
        /usr/lib/sa/sa2 -A
	success "$msg"
	echo
	rm -f /var/lock/subsys/sysstat
        ;;
  *)
        echo "Usage: sysstat {start|stop}"
        exit 1
esac

exit 0

