Hi,
here is my first script for cacti to display infos about zone/pset Usage on a Solaris 10 System using zone's/pset's.
From the README:
This programm/scripts and templates are for displaying information about Solaris 10 Zone CPU Usage und Solaris 10 processor set usage, and are my first things i made for cacti, so be carefull
zonestat collects two types of data.
- For a processor set it display the raw counter for the cpu usage split up
into user/kernel/wait/idle
- For a zone a takes a snapshot of the current CPU/memory usage based on the information
found in /proc/<pid>. The infos are:
CPU usage in percent
Memory usage in percent
Total used memory
Resident size of memory
The templates used for the data collect and display are not complete yet..
Requirements:
- net-snmp on the client side
- cacti with script support and php with snmp support
Installation:
- Compile zonestat (Tested with Studio 11 cc)
- Add the following to your snmp configuration:
exec .1.3.6.1.4.1.2021.51 procstat <path>/zonestats
- Import the data query template
- Import the data template
- Import the graph template
If everything went OK you should see a two new data query's which can be attached to your device. If
you run them in verbose mode you should the your processor sets and zone's.
I know it's not perfect ,
Script for solaris 10 zone/pset
Moderators: Developers, Moderators
Script for solaris 10 zone/pset
- Attachments
-
- zstat.zip
- (19.28 KiB) Downloaded 1557 times
-
- Posts: 1
- Joined: Tue Apr 17, 2007 10:40 am
- Location: Cambridge, MA
RE: Script for solaris 10 zone/pset
hello,
I get different results if I compile zonestats.c with gcc or sunpro (studio 11) when run in zone or in the global zone.
bash-3.00# /usr/local/sbin/zonestats.sunpro
pset:1:pset_nexdoc:14310895:652859238:4742173:0:
psetpset_default:84097553:1815621738:116020092:0:
bash-3.00# /usr/local/sbin/zonestats.gcc
pset:1:pset_nexdoc:14310900:652863054:4742187:0:
psetpset_default:84097750:1815632614:116020527:0:
zone:1:global:1.16:18.31:3022424:4196920:99
zone:2:marx-test-z1:0.03:0.82:137808:619640:42
zone:3:marx-test-z2:0.02:0.92:158592:495360:50
zone:4:marx-test-z3:0.01:0.79:132632:422976:42
zone:5:marx-test-z4:0.04:1.11:189264:790880:49
zone:6:marx-test-z5:0.03:1.91:320744:874888:47
zone:7:marx-test-z6:0.24:2.24:377656:1688704:66
In a zone, I see ...
# /usr/local/sbin/zonestats.gcc
psetpset_default:84093622:1815379484:116009764:0:
zone:1:marx-test-z3:0.18:0.83:138832:431296:43
# /usr/local/sbin/zonestats.sunpro
psetpset_default:84094095:1815382378:116010105:0:
I get different results if I compile zonestats.c with gcc or sunpro (studio 11) when run in zone or in the global zone.
bash-3.00# /usr/local/sbin/zonestats.sunpro
pset:1:pset_nexdoc:14310895:652859238:4742173:0:
psetpset_default:84097553:1815621738:116020092:0:
bash-3.00# /usr/local/sbin/zonestats.gcc
pset:1:pset_nexdoc:14310900:652863054:4742187:0:
psetpset_default:84097750:1815632614:116020527:0:
zone:1:global:1.16:18.31:3022424:4196920:99
zone:2:marx-test-z1:0.03:0.82:137808:619640:42
zone:3:marx-test-z2:0.02:0.92:158592:495360:50
zone:4:marx-test-z3:0.01:0.79:132632:422976:42
zone:5:marx-test-z4:0.04:1.11:189264:790880:49
zone:6:marx-test-z5:0.03:1.91:320744:874888:47
zone:7:marx-test-z6:0.24:2.24:377656:1688704:66
In a zone, I see ...
# /usr/local/sbin/zonestats.gcc
psetpset_default:84093622:1815379484:116009764:0:
zone:1:marx-test-z3:0.18:0.83:138832:431296:43
# /usr/local/sbin/zonestats.sunpro
psetpset_default:84094095:1815382378:116010105:0:
Command failed for target `zonestats'
hi,
try this on "SunOS 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220System = SunOS"
/opt/studio11/SUNWspro/bin/cc -g zonestats.c -o zonestats
Undefined first referenced
symbol in file
pool_conf_open zonestats.o
kstat_chain_update zonestats.o
pool_query_resources zonestats.o
pool_resource_info zonestats.o
pool_dynamic_location zonestats.o
kstat_read zonestats.o
kstat_open zonestats.o
pool_value_alloc zonestats.o
pool_value_set_string zonestats.o
pool_value_set_int64 zonestats.o
pool_value_free zonestats.o
pool_value_set_name zonestats.o
pool_conf_alloc zonestats.o
ld: fatal: Symbol referencing errors. No output written to zonestats
*** Error code 1
make: Fatal error: Command failed for target `zonestats'
try this on "SunOS 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220System = SunOS"
/opt/studio11/SUNWspro/bin/cc -g zonestats.c -o zonestats
Undefined first referenced
symbol in file
pool_conf_open zonestats.o
kstat_chain_update zonestats.o
pool_query_resources zonestats.o
pool_resource_info zonestats.o
pool_dynamic_location zonestats.o
kstat_read zonestats.o
kstat_open zonestats.o
pool_value_alloc zonestats.o
pool_value_set_string zonestats.o
pool_value_set_int64 zonestats.o
pool_value_free zonestats.o
pool_value_set_name zonestats.o
pool_conf_alloc zonestats.o
ld: fatal: Symbol referencing errors. No output written to zonestats
*** Error code 1
make: Fatal error: Command failed for target `zonestats'
Re: Command failed for target `zonestats'
add -lpool and -lkstat to CFLAGS.kasimong wrote:hi,
try this on "SunOS 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220System = SunOS"
/opt/studio11/SUNWspro/bin/cc -g zonestats.c -o zonestats
Undefined first referenced
symbol in file
pool_conf_open zonestats.o
kstat_chain_update zonestats.o
pool_query_resources zonestats.o
pool_resource_info zonestats.o
pool_dynamic_location zonestats.o
kstat_read zonestats.o
kstat_open zonestats.o
pool_value_alloc zonestats.o
pool_value_set_string zonestats.o
pool_value_set_int64 zonestats.o
pool_value_free zonestats.o
pool_value_set_name zonestats.o
pool_conf_alloc zonestats.o
ld: fatal: Symbol referencing errors. No output written to zonestats
*** Error code 1
make: Fatal error: Command failed for target `zonestats'
I get the same results. I'm going w/ gcc compiled binary in the global zone, with hopes I can validate the results with some "prstat -Z" parsing....hello,
I get different results if I compile zonestats.c with gcc or sunpro (studio 11) when run in zone or in the global zone.
bash-3.00# /usr/local/sbin/zonestats.sunpro
pset:1:pset_nexdoc:14310895:652859238:4742173:0:
psetpset_default:84097553:1815621738:116020092:0:
bash-3.00# /usr/local/sbin/zonestats.gcc
pset:1:pset_nexdoc:14310900:652863054:4742187:0:
psetpset_default:84097750:1815632614:116020527:0:
zone:1:global:1.16:18.31:3022424:4196920:99
zone:2:marx-test-z1:0.03:0.82:137808:619640:42
zone:3:marx-test-z2:0.02:0.92:158592:495360:50
zone:4:marx-test-z3:0.01:0.79:132632:422976:42
zone:5:marx-test-z4:0.04:1.11:189264:790880:49
zone:6:marx-test-z5:0.03:1.91:320744:874888:47
zone:7:marx-test-z6:0.24:2.24:377656:1688704:66
In a zone, I see ...
# /usr/local/sbin/zonestats.gcc
psetpset_default:84093622:1815379484:116009764:0:
zone:1:marx-test-z3:0.18:0.83:138832:431296:43
# /usr/local/sbin/zonestats.sunpro
psetpset_default:84094095:1815382378:116010105:0:
Re: Script for solaris 10 zone/pset
Hi,
I have been trying to get zone information for Cacti for ages and I have just stumbled upon your zonestat script/queries.
I have compiled the source on an x86 solaris server using gcc with the added cflags but everytime I run the script I get a core dump of zonestats.
Are there any specifics for x86 solaris that I need to be aware of , or are we talking a complete re-write of the code.
Many thanks
Stu
I have been trying to get zone information for Cacti for ages and I have just stumbled upon your zonestat script/queries.
I have compiled the source on an x86 solaris server using gcc with the added cflags but everytime I run the script I get a core dump of zonestats.
Are there any specifics for x86 solaris that I need to be aware of , or are we talking a complete re-write of the code.
Many thanks
Stu
Who is online
Users browsing this forum: No registered users and 3 guests