no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | monitors:gmirror [2011/08/12 04:33] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== FreeBSD gmirror (geom based RAID-1) monitor ====== | ||
+ | |||
+ | ^ Author | [[ Brian.Scott@tafensw.edu.au | Brian Scott ]] | | ||
+ | ^ Compatibility | Xymon 4.3 | | ||
+ | ^ Requirements | FreeBSD, Bourne Shell (sh) | | ||
+ | ^ Download | None | | ||
+ | ^ Last Update | 2011-08-12 | | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | Simple shell script to monitor FreeBSD geom based mirroring. | ||
+ | |||
+ | Status is red for degraded (missing a component) and yellow when recovering. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | Pretty much standard fare: | ||
+ | < | ||
+ | [gmirror] | ||
+ | ENVFILE / | ||
+ | NEEDS xymond | ||
+ | CMD $XYMONHOME/ | ||
+ | LOGFILE $XYMONSERVERLOGS/ | ||
+ | INTERVAL 5m | ||
+ | </ | ||
+ | |||
+ | Or the equivalent on the client side. | ||
+ | ===== Source ===== | ||
+ | ==== gmirror.sh ==== | ||
+ | |||
+ | <hidden onHidden=" | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | |||
+ | COLUMN=gmirror | ||
+ | |||
+ | HOSTNAME=" | ||
+ | COLOUR=green | ||
+ | |||
+ | # % gmirror status | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # mirror/ | ||
+ | # | ||
+ | # mirror/ | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # STARTING, COMPLETE, DEGRADED -> yellow, green, red | ||
+ | / | ||
+ | rc=$? | ||
+ | SECONDS=`egrep " | ||
+ | |||
+ | if [ $rc -ne 0 ]; then | ||
+ | COLOUR=red | ||
+ | MSG=" | ||
+ | |||
+ | `cat $XYMONTMP/ | ||
+ | |||
+ | Seconds: ${SECONDS} | ||
+ | " | ||
+ | else | ||
+ | grep ' DEGRADED ' $XYMONTMP/ | ||
+ | if [ $? -eq 0 ]; then | ||
+ | COLOUR=red | ||
+ | else | ||
+ | grep ' STARTING ' $XYMONTMP/ | ||
+ | if [ $? -eq 0 ]; then | ||
+ | COLOUR=yellow | ||
+ | fi | ||
+ | fi | ||
+ | MSG=" | ||
+ | |||
+ | `cat $XYMONTMP/ | ||
+ | |||
+ | Seconds: ${SECONDS} | ||
+ | " | ||
+ | fi | ||
+ | $XYMON $XYMSRV " | ||
+ | |||
+ | $MSG" | ||
+ | $RM $XYMONTMP/ | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Known Bugs and Issues ===== | ||
+ | |||
+ | ===== To Do ===== | ||
+ | |||
+ | Nice features like green/ | ||
+ | |||
+ | Ability to exclude mirrors that we don't care about. | ||
+ | |||
+ | ===== Credits ===== | ||
+ | As with all of these things, the code started out by kicking around other people' | ||
+ | ===== Changelog ===== | ||
+ | |||
+ | * **2011-08-12** | ||
+ | * Initial release | ||