I am sure many of the Solaris administrators will break their head in an order to find Solaris local zones wise resource utilization details on oracle Solaris 10. Because there is no simple inbuilt tool to find these details in Solaris 10 (Apart from prstat -Z). I just come across Jeff Victor’s Blog and found this script which will be very useful in Unix administration. This script will help you to find resource consumption of each Solaris local zone from the global zone level. Just give a try.
This script will give the following information:
- CPU Pool size
- Capped Physical Memory (aka RAM)
- Used Physical Memory
- Capped Swap space (Virtual Memory aka VM)
- Used shared memory
- Locked Memory
- Used Swap space (aka virtual memory)
Here I will demonstrate how to use this script and explanation about each field in zonestat script output.
Download the zonestat.pl script and make it executable.
Download the zonestat.pl script and make it executable.
Here is the sample output of the script.
bash-3.00# ./zonestat.pl |--Pool--|Pset|-------Memory-----| Zonename| IT|Size|Used| RAM| Shm| Lkd| VM| ------------------------------------------ global 0D 2 0.0 103M 256K 258K 431M sol1 0D 2 0.0 82M 0.0 0.0 169M ==TOTAL= --- 2 0.1 185M 256K 258K 1.2G bash-3.00# ./zonestat.pl -l |----Pool-----|---CPU-----|----------------Memory----------------| |---|--Size---|Pset-------|---RAM---|---Shm---|---Lkd---|---VM---| Zonename| IT| Max| Cur|Used|Shr|S%| Cap|Used| Cap|Used| Cap|Used| Cap|Used -------------------------------------------------------------------------- global 0D 2 2 0.1 1 50 91M 18E 256K 18E 258K 18E 423M sol1 0D 2 2 0.0 1 50 77M 18E 0.0 18E 0.0 18E 169M ==TOTAL= --- ---- 2 0.1 --- -- 789M 168M 789M 256K 755M 258K 1.3G 1.2G bash-3.00# ./zonestat.pl interval 4 |--Pool--|Pset|-------Memory-----| Zonename| IT|Size|Used| RAM| Shm| Lkd| VM| ------------------------------------------ global 0D 2 0.0 92M 256K 258K 423M sol1 0D 2 0.0 76M 0.0 0.0 169M ==TOTAL= --- 2 0.0 168M 256K 258K 1.2G -------- global 0D 2 0.0 91M 256K 258K 423M sol1 0D 2 0.0 75M 0.0 0.0 169M ==TOTAL= --- 2 0.0 166M 256K 258K 1.2G -------- global 0D 2 0.0 91M 256K 258K 423M sol1 0D 2 0.0 75M 0.0 0.0 169M ==TOTAL= --- 2 0.0 166M 256K 258K 1.2G -------- global 0D 2 0.0 91M 256K 258K 423M sol1 0D 2 0.0 75M 0.0 0.0 169M ==TOTAL= --- 2 0.0 166M 256K 258K 1.2G
You have the help option to know each field in zonestat command output.
bash-3.00# ./zonestat.pl -help Usage: zonestat [-h] | [-l] [interval [count]] -h: usage information -l: display columns showing the configured limits Output with -l option: |----Pool-----|------CPU-------|----------------Memory----------------| |---|--Size---|-----Pset-------|---RAM---|---Shm---|---Lkd---|---VM---| Zonename| IT| Max| Cur| Cap|Used|Shr|S%| Cap|Used| Cap|Used| Cap|Used| Cap|Used Pool: information about the Solaris Resource Pool to which the zone is assigned. I: Pool identification number for this zone's pool T: Type of pool: D=Default, P=Private (temporary), S=Shared Max: Maximum number of CPUs configured for this zone's pool Cur: Current number of CPUs configured for this zone's pool CPU: information about CPU controls and usage Cap: CPU-cap for the zone Used: Amount of CPU power consumed by the zone recently Shr: Number of FSS shares assigned to this zone S%: Percentage of this pool's CPU cycles for this zone ('HH' = 100%) Memory: information about memory controls and usage RAM: Physical memory information Cap: Maximum amount of RAM this zone can use Used: Amount of RAM this zone is using Shm: Shared memory information Cap: Maximum amount of shared memory this zone can use Used: Amount of shared memory this zone is using Lkd: Locked memory information Cap: Maximum amount of locked memory this zone can use Used: Amount of locked memory this zone is using VM: Virtual memory information Cap: Maximum amount of virtual memory this zone can use Used: Amount of virtual memory this zone is using
Hope this article is informative to you.
kishore says
Unable to download the script , please provide the approval to download it
Lingeswaran R says
Please check it now.
Bhaskar says
Hi Lingeswaran,
I am happy to subscribe hear, because your articles are very useful for every one, even senior engineers also,
i need your suggestion
i am a unix and linux administration on last 8 years
Planing to improve my technologies to AWS
Please suggest the correct technology to improve my self .
Surendran says
Hi…
Thanks for sharing the alternative method to execute zonestat command in Solaris 10.
I am unable to download the perl script, getting “Server Not Found” error. Can u share the file via mail..
Lingeswaran R says
Sent via email. Please try to download using the google account.
Regards
Lingeswaran
Paul says
Hello,
thank you for writing this script first off.
my question is, I would love to run this script you have written, but I am finding it hard finding the zonestat pkg to install…. Can you point me in the right direction to find zonestat and install that first?
thank you
Paul….
Lingeswaran R says
As per my knowledge,zonestat package available from Solaris 11. For Solaris 10 , you need to use the script what i have attached
Regards
Lingeswaran