Re: [zones-discuss] zonename

2009-06-10 Thread Matt Baker
I created a script, that can be accessed outside of the zone (copied in, NAS 
mount, etc - but doesn't require any special build/access for the zone).

It looks for a common MAC from the zone's MAC to the global zone's MAC.  It 
isn't perfect, but gives a list of IPs to look against.


#!/bin/ksh
#

#
# Tries to determine the global name for the local/non-global zone by using arp.
# May not always be accurate or successful.
#
# Written by Matt Baker  mba...@computeranddata.com
# 8/22/2008
# Version 1.0
#


if [[ $(uname) == SunOS   $(uname -r | awk -F. '{print $2}') -ge 10 ]]
then
if [[ $(zonename) != global ]]
then
ping  $(hostname)
MYZONEIP=$(grep -w $(hostname) /etc/hosts | awk '{print $1}')
MYZONEMAC=$(/usr/sbin/arp -na \
| grep $MYZONEIP \
| awk '{print $NF}')
MYZONEVIPS=$(ifconfig -a | grep inet \
 | grep -v 127.0.0.1 \
 | awk '{print $2}'\
 | grep -v $MYZONEIP )
MYZONEVIPS=$(echo $MYZONEVIPS | sed -e 's/ /|/')

#
# give it something dumb so I don't have to make another test case
#
if [[ -z $MYZONEVIPS ]]
then
MYZONEVIPS=0.0.0.0|0.0.0.1
fi  

print -n My possible Globals are: 
GLOBAL=$(/usr/sbin/arp -na \
| grep $MYZONEMAC \
| egrep -v $MYZONEVIPS \
| awk '{print $2}' \
| sort )

if [[ -n $GLOBAL ]]
then
print $GLOBAL
else
print ERROR:1: CANNOT FIND GLOBALNAME - Sorry.
exit 1
fi
else
print ERROR:3: You already in a global zone, use 'zoneadm list -civ'.
exit 3
fi

else
print ERROR:2: Only works on Solaris 10 or greater.
exit 2
fi
-- 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org


[zones-discuss] zonestat 1.4.1 problem

2009-06-10 Thread Phil Freund
I have a couple of servers that are still running U1 but I'd still like to use 
zonestat to get as much info as I can.

I get the following output when I run zonestat 1.4.1 with debug turned on:

root zonestat -l -N
/usr/sbin/prtconf
/bin/pagesize
/bin/echo 'pages_pp_maximum/D;segspt_minfree/D' | mdb -k
/usr/sbin/zoneadm list -v
/usr/sbin/psrinfo
/usr/bin/svcs -H pools
svcs: Pattern 'pools' doesn't match any instances
/bin/ps -eo zone,pset,pid,comm | grep ' [z]*sched'
/usr/bin/ipcs -mbZ
Attempt to access disallowed key 'caps' in a restricted hash at zonestat line 
502.
root

Any ideas on how to fix this?

Thanks,
Phil
-- 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org