#!/bin/sh
#######################################################################
#
#Copyright @ 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A.
#All rights reserved.U.S. Government Rights - Commercial software.  Government users are subject to the
#Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements.
#Use is subject to license terms.  Sun,  Sun Microsystems,  the Sun logo and  Sun Ray are trademarks or
#registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.UNIX is a registered trademark
#in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.
#
#SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
#THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
#TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
#PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
#ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
#DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
#
#
## Source: canary_probe_shmlist
## Application Name: Canary
## Application SIC Code:
## CVS ID: @(#) $Id: canary_probe_shmlist,v 2.3 2007/06/07 18:02:50 waynec Exp $ Sun IT
#
## Author: Sean Meighan
## Date Created: March 2004
#
## General Description(Purpose):  Simple System Monitoring Application is a simple yet powerful monitoring
## tool that lets you quickly identify error conditions on systems running
## Solaris (SPARC and x86) and Linux.   The Monitor is useful for locating
## and monitoring sources of unusual program load, such as runaway processes,
## memory leaks, problems with network interface traffic, etc.
#
## Usage:
#
## Required Parameters:
## Optional Parameters:
## Return Codes:
#
## Possible Points of Failure:
#
#
#######################################################################

set -a
. ./canary_env.sh
. ./canary_env_static.sh
set +a

echo
echo "************"
uname -n
if [ $OS = linux ]; then
ipcs -ms -u 

else
ipcs -msb | $AWK 'BEGIN { mt = 0; mc = 0; sc = 0; } { if ($1 == "m") { mt += $7; mc += 1; } if ($1 == "s") { sc += 1; } } END { print "total shm bytes in use: " mt; print "total shm entries in use: " mc ; print "total sem entries: " sc ; }'
#
# If /etc/system overrides exist, print them out
#
grep shminfo_shmmni /etc/system
grep seminfo_semmni /etc/system
fi
/bin/echo "************"

