====== zones.ksh ====== ^ Author | [[ everett.vernon@gmail.com | Vernon Everett ]] | ^ Compatibility | Xymon 4.2 | ^ Requirements | Solaris Zones | ^ Download | None | ^ Last Update | 2010-06-10 | ===== Description ===== 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. ===== Installation ===== === 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 ===== Source ===== ==== zones.ksh ==== #!/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 ===== Known Bugs and Issues ===== 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) ===== To Do ===== 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 ===== Credits ===== I accept all the blame for this one. ===== Changelog ===== * **2010-06-10** * Initial release