You could also monitor local and use an agent to check status of a log. I've 
done this for a VCS Agent Script to monitor states.  Got the code from 
somewhere on the net, a while ago.
With the boot cycle of NGZ's being so fast, it was too easy for a simple 
zoneadm monitor script to miss a change in state.

Dont use Sun Cluster much, but I bet the concept can be applied there. or the 
track down the zone_status_set:entry specific to Sun Cluster state changes and 
replace where needed. Plus this will give you a historical log. Recommend 
adding time stamps in the dtrace output.

Using Dtrace to monitor non-global zones
Current defined zone states from zone.h
/* zone_status */
enum { 
} zone_status_t;

Dtrace code - can be run via cron with output to a monitored file - VCS Agent 
Monitor Script can scrub the file for status
/usr/sbin/dtrace -qs
state[0] = "Uninitialized"; 
state[1] = "Ready"; 
state[2] = "Booting"; 
state[3] = "Running"; 
state[4] = "Shutting down"; 
state[5] = "Empty"; 
state[6] = "Down"; 
state[7] = "Dying"; 
state[8] = "Dead";

zone_status_set:entry {
printf("Zone %s status %s\n", stringof(args[0]->zone_name), state[args[1]]);

Example output of dtrace code above
# ./zonestatus.d 
Zone aap status Ready 
Zone aap status Booting 
Zone aap status Running 
Zone aap status Shutting down 
Zone aap status Down 
Zone aap status Empty 
Zone aap status Dying 
Zone aap status Ready 
Zone aap status Dead 
Zone aap status Booting

On Feb 24, 2010, at 8:35 PM, Jason King wrote:

> I will note that the sysevent info is defined in
> /usr/include/sys/zone.h, so they could (with all the usual caveats
> that it could change in the future, etc.) use that (though on a
> tangent -- are there _any_ documented sysevents?  all i've ever found
> is the subsystem itself is documented, but none of the events
> themselves are, which I always found a bit odd).
> On Wed, Feb 24, 2010 at 7:23 PM, Dennis Clarke <> wrote:
>>> IKOAC (I know of a customer) that would like to write an
>>> agent that runs in the global zone and detects state changes
>>> in the non-global zones on the system.
>>> Anyone listening been down this road???
>> Can you define "state" change ?
>> I am guessing you mean a change in some foo of type zone_cluster_state_t
>> where :
>> typedef enum {
>> } zone_cluster_state_t;
>> If so then I wrote a small script but it is just a script and it uses
>> zoneadm to pull out the state of all zones on the server and report them
>> in a table with hostnames and other info. Not sure if this is what you
>> mean. You may be thinking of an SNMP agent or something like that. Not
>> sure.
>> Dennis
>> _______________________________________________
>> zones-discuss mailing list
> _______________________________________________
> zones-discuss mailing list

zones-discuss mailing list

Reply via email to