monitors:zones

zones.ksh

Author Vernon Everett
Compatibility Xymon 4.2
Requirements Solaris Zones
Download None
Last Update 2010-06-10

A really simple view of what zones are running on a monitored host.

No alerts, just an informative view of the zones, their status, and some relavant information.

Client side

Copy zones.ksh in hobboit/xymon ext directory (usually in HOBBITCLIENTHOME/ext)

Add the following to clientlaunch.cfg

[zones]
      ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
      CMD $HOBBITCLIENTHOME/ext/zones.ksh
      LOGFILE $HOBBITCLIENTHOME/logs/zones.log
      INTERVAL 5m

Server side

No Changes

Show Code ⇲

Hide Code ⇱

#!/bin/ksh
[ $(/usr/bin/zonename) == "global" ] || exit 0  # I only run on global zones
TEMPFILE=$BBTMP/zones.tmp

date > $TEMPFILE
zoneadm list -cv >> $TEMPFILE
echo "" >> $TEMPFILE
zoneadm list -cv | awk '{ print $2 }' | egrep -v "NAME|global" | while read ZONE
do
     zonecfg -z $ZONE info | egrep "zonename|zonepath|ip-type|address|physical|ncpus|physical|\[swap" | sed "s/\[//g"| sed "s/\]//g" >> $TEMPFILE
     echo "" >> $TEMPFILE
done

$BB $BBDISP "status $MACHINE.zones green $(cat $TEMPFILE)"
rm $TEMPFILE

None, but feel free to let me know if you find any.

(I don't think this script is complex enough to have any bugs)

If I find the time, I might make the information it displays configurable. For now it's hard coded to

  • zonename
  • zonepath
  • ip-type
  • ip-address
  • physical NIC
  • ncpus

I accept all the blame for this one.

  • 2010-06-10
    • Initial release
  • monitors/zones.txt
  • Last modified: 2010/06/10 05:21
  • by 127.0.0.1