Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 25, 2019 12:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Script for solaris 10 zone/pset
PostPosted: Tue Jan 16, 2007 3:03 pm 
Offline

Joined: Tue Jan 16, 2007 1:37 pm
Posts: 3
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 :lol: ,


Attachments:
zstat.zip [19.28 KiB]
Downloaded 1515 times
Top
 Profile  
 
 Post subject: RE: Script for solaris 10 zone/pset
PostPosted: Tue Apr 17, 2007 11:13 am 
Offline

Joined: Tue Apr 17, 2007 10:40 am
Posts: 1
Location: Cambridge, MA
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:
pset:-1:pset_default:84097553:1815621738:116020092:0:

bash-3.00# /usr/local/sbin/zonestats.gcc
pset:1:pset_nexdoc:14310900:652863054:4742187:0:
pset:-1:pset_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
pset:-1:pset_default:84093622:1815379484:116009764:0:
zone:1:marx-test-z3:0.18:0.83:138832:431296:43

# /usr/local/sbin/zonestats.sunpro
pset:-1:pset_default:84094095:1815382378:116010105:0:


Top
 Profile  
 
 Post subject: Command failed for target `zonestats'
PostPosted: Thu May 22, 2008 6:14 am 
Offline

Joined: Tue Oct 02, 2007 7:54 am
Posts: 40
Location: Bremerhaven,Bremen,Germany
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'


Top
 Profile  
 
 Post subject: Re: Command failed for target `zonestats'
PostPosted: Tue Nov 25, 2008 1:37 pm 
Offline

Joined: Wed Dec 26, 2007 12:09 pm
Posts: 4
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'


add -lpool and -lkstat to CFLAGS.

Quote:
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:
pset:-1:pset_default:84097553:1815621738:116020092:0:

bash-3.00# /usr/local/sbin/zonestats.gcc
pset:1:pset_nexdoc:14310900:652863054:4742187:0:
pset:-1:pset_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
pset:-1:pset_default:84093622:1815379484:116009764:0:
zone:1:marx-test-z3:0.18:0.83:138832:431296:43

# /usr/local/sbin/zonestats.sunpro
pset:-1:pset_default:84094095:1815382378:116010105:0:


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....
:o


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 18, 2010 1:06 pm 
Offline

Joined: Mon Nov 02, 2009 9:04 am
Posts: 5
Hi,

I don't see Zone Data Queries in the archive, is it normal ?

Regards


Top
 Profile  
 
 Post subject: Re: Script for solaris 10 zone/pset
PostPosted: Wed Nov 10, 2010 1:37 pm 
Offline

Joined: Thu Apr 01, 2010 5:49 am
Posts: 15
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group