Solaris Container Trick #1 : Monitoring Users Processes
Here is a simple little trick that will give Solaris 10 Admins a bit
more control over monitoring their system processes in each zone.
One
"feature" of Solaris Containers is that the namespace seems to be
consistant globally across all zones. This means that the userid #
which gets assigned when you create a user with the "-u" option is
visible on the Global Zone. Keep in mind in the non-global zones,
these users are not visible from peer zones.
To set this up, make sure that you have consistant user id# across all zones (incl. the Global zone).
# useradd -u 101 -g jes -d /opt jeszone1
# useradd -u 102 -g jes -d /opt jeszone2
# useradd -u 103 -g jes -d /opt jeszone3
# useradd -u 104 -g jes -d /opt jeszone4
Now you can view these processes in the Global Zone.
# prstat -ZPID USERNAME SIZE &
28007 root 612M 41M sleep 59 0 0:00:03 0.1% java/43
27265 root 114M 56M sleep 59 0 0:00:28 0.0% java/53
27906 jeszone2 220M 205M sleep 59 0 0:00:09 0.0% ns-slapd/45
28003 root 4976K 4968K cpu4 49 0 0:00:00 0.0% prstat/1
15021 root 150M 87M sleep 59 0 0:01:57 0.0% java/57
25458 jeszone1 300M 128M sleep 59 0 0:00:37 0.0% webservd/73
21426 root 2488K 2128K sleep 59 0 0:01:09 0.0% rpc.rstatd/1
23387 root 158M 87M sleep 59 0 0:51:28 0.0% java/57
23280 jeszone1 241M 225M sleep 59 0 0:00:29 0.0% ns-slapd/45
200 root 2112K 1624K sleep 59 0 0:00:00 0.0% sac/1
189 root 2616K 2032K sleep 59 0 0:00:00 0.0% keyserv/3
111 root 6720K 6376K sleep 59 0 0:00:27 0.0% nscd/26
199 daemon 2456K 2160K sleep 60 -20 0:00:00 0.0% lockd/2
21502 root 1376K 1344K sle5ep 59 0 0:00:00 0.0% sh/1
108 root 4888K 4208K sleep 59 0 0:00:00 0.0% picld/5
ZONEID NPROC SIZE RSS MEMORY TIME CPU ZONE
10 36 1081M 402M 1.2% 0:01:10 0.2% zone2
0 57 427M 289M 0.8% 0:55:47 0.0% global
8 34 862M 565M 1.7% 0:03:38 0.0% zone1
( Aug 03 2006, 02:38:23 PM PDT ) Permalink
Comments [1]
Comments are closed for this entry.



Anyway, there is no such thing as a "root zone" or a "non root zone"-- there are global zones, and non-global zones.
Posted by 192.18.43.11 on August 03, 2006 at 04:38 PM PDT #