#!/bin/ksh -p # COPYRIGHT: Copyright (c) 2008 Stefan Parvu. # CDDL HEADER START # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # You can obtain a copy of the license at Docs/cddl1.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # CDDL HEADER END # # VERSION: 0.60 # # HISTORY # 2007-04-10 Stefan Parvu, ver 0.50. # 2008-07-09 Stefan Parvu, ver 0.60. # ######### # # MAIN BODY # # ######### # PWD=$(dirname $0) . ${PWD}/setenv if [[ ${OS_NAME} != "SunOS" ]] then print "Error: cannot run on this OS: $(uname -s)" print "This collector requires Solaris 10 x86, sparc" exit 1 fi # check root if (( USER_ID != 0 )) then print "Error: ${0##*/} requires root privileges" exit 1 fi if [[ ${PT_NAME} != "sun4v" ]] then print "Error: cannot run on this platform: $(uname -m)" print "${0##*/} requires CMT: T1,T2 architecture" exit 1 else case "$(uname -i)" in SUNW,SPARC-Enterprise-T5120) CORESTAT=corestat.t2 ;; SUNW,Sun-Fire-T200) CORESTAT=corestat.t1 ;; esac fi if (( $# < 1 || $# > 1 )) then print "Usage: ${0##*/} secs" print " secs - minim 60 secs" exit 1 else if (( $1 < 60 )) then print "Usage: ${0##*/} secs" print " secs - minim 60 secs" exit 1 fi fi secs=0 (( secs = $1 - 12 )) while true do print "$(date +"%Y-%m-%d:%H:%M:%S") - $(perl -e 'print time();')" print "$(${MONITOR_BIN}/${CORESTAT})\n" sleep $secs done