monitors:bb-zfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
monitors:bb-zfs [2020/04/20 07:57] – [Installation] freesoftwareserversmonitors:bb-zfs [2020/04/21 01:05] – [Changelog] freesoftwareservers
Line 1: Line 1:
 ====== bb-zfs ====== ====== bb-zfs ======
  
-^ Author | [[ everett.vernon@gmail.com | Vernon Everett ]] | +^ Author         | [[everett.vernon@gmail.com| Vernon Everett ]]  
-^ Compatibility | Xymon 4.2 | +^ Compatibility  | Xymon 4.2                                      
-^ Requirements | ZFS | +^ Requirements   | ZFS                                            
-^ Download | None | +^ Download       | None                                           
-^ Last Update | 2010-07-21 |+^ Last Update    2020-04-20                                     |
  
 ===== Description ===== ===== Description =====
Line 16: Line 16:
     [zfs]     [zfs]
         ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg         ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
-        CMD $HOBBITCLIENTHOME/ext/bb-zfs.sh+        CMD $HOBBITCLIENTHOME/ext/bb-zfs.ksh
         LOGFILE $HOBBITCLIENTHOME/logs/zfs.log         LOGFILE $HOBBITCLIENTHOME/logs/zfs.log
         INTERVAL 5m         INTERVAL 5m
Line 36: Line 36:
 </code> </code>
   * In hobbitserver.cfg, add the following line   * In hobbitserver.cfg, add the following line
-<code> SPLITNCV_zfs="*:GAUGE"+<code> GRAPHS="...,xymond,zfs" 
 +TEST2RRD="...,xymond,zfs=ncv" 
 +SPLITNCV_zfs="*:GAUGE"
 </code> </code>
- 
-  * Add zfs=ncv to TEST2RRD= 
-  * Add zfs to GRAPHS= 
  
 ===== Source ===== ===== Source =====
Line 53: Line 52:
 # 4. Vernon Everett <everett.vernon@gmail.com : Added check for old snapshots # 4. Vernon Everett <everett.vernon@gmail.com : Added check for old snapshots
 #                                             : Added graphing data #                                             : Added graphing data
 +# 5. FreeSoftwareServers <admin@freesoftwareservers.com>: 
 +# Update to new "zpool list -h" format
 +# Add Available/Free to table
 +# Full "zpool status" always displayed
 +# Set DEGRADED=RED
 +# DISKYELL=90 & DISKRED=95
  
-DISKYELL=80 +DISKYELL=90 
-DISKRED=90+DISKRED=95
 SNAPRED=90  # Days old SNAPRED=90  # Days old
 SNAPYELL=60 # Days old SNAPYELL=60 # Days old
 SNAPCOL=true  # Set to true if snapshot age should effect test colour SNAPCOL=true  # Set to true if snapshot age should effect test colour
-CHECKSNAPS=true # Set to true to do snapshot checking+CHECKSNAPS=true# Set to true to do snapshot checking
 TEST="zfs" TEST="zfs"
 DISPCOLOR="green" DISPCOLOR="green"
Line 68: Line 73:
  
 #What: beautify the page display by html code. #What: beautify the page display by html code.
-STRING="<table border=1 cellpadding=10><tr><th></th><th>Zpool Name</th><th>Status</th><th>Capacity</th></tr>"+STRING="<table border=1 cellpadding=10><tr><th></th><th>Zpool Name</th><th>Status</th><th>Allocated</th><th>Free</th><th>Capacity</th></tr>"
 #What: a loop to parse output of "zpool list -H" output. #What: a loop to parse output of "zpool list -H" output.
 # bash-3.00# zpool list # bash-3.00# zpool list
 # NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT # NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
 # mypool                 33.8G   84.5K   33.7G     0%  ONLINE     - # mypool                 33.8G   84.5K   33.7G     0%  ONLINE     -
 +#####UPDATE####
 +#
 +#:# zpool list
 +#NAME     SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
 +#raid-z  18.1T  13.6T  4.54T             0%    74%  1.00x  ONLINE  -
 # bash-3.00# zpool list -H # bash-3.00# zpool list -H
 # mypool  33.8G   84.5K   33.7G   0%      ONLINE  - # mypool  33.8G   84.5K   33.7G   0%      ONLINE  -
 # bash-3.00# # bash-3.00#
  
-/usr/sbin/zpool list -H | while read name size used avail cap health altroot+ 
 +zpool list -H | while read name size alloc free expandsz frag cap dedup health altroot
 do do
   LINE_COLOR="green"   LINE_COLOR="green"
Line 84: Line 95:
     HEALTH_COLOR="green"     HEALTH_COLOR="green"
   elif [ "${health}" == "DEGRADED" ]; then   elif [ "${health}" == "DEGRADED" ]; then
-    HEALTH_COLOR="yellow"+    HEALTH_COLOR="red"
   elif [ "${health}" == "FAULTED" ]; then   elif [ "${health}" == "FAULTED" ]; then
     HEALTH_COLOR="red"     HEALTH_COLOR="red"
   fi   fi
 +
  
   CAP_COLOR="green"   CAP_COLOR="green"
Line 96: Line 108:
     CAP_COLOR="red"     CAP_COLOR="red"
   fi   fi
-  DATA=$(/usr/bin/echo "$name : $cap\n$DATA")+  DATA=$(echo "$name : $cap\n$DATA")
  
 # Determine the line colours # Determine the line colours
Line 103: Line 115:
  
 # Determine the messages # Determine the messages
-  [ "$HEALTH_COLOR" == "yellow" -a "$FIRST_LINE_HEALTH" != "faulted" ] && FIRST_LINE_HEALTH="degraded+  [ "$HEALTH_COLOR" == "red" -a "$FIRST_LINE_HEALTH" != "faulted" ] && FIRST_LINE_HEALTH="DEGRADED
-  [ "$HEALTH_COLOR" == "red" ] && FIRST_LINE_HEALTH="faulted"+  [ "$HEALTH_COLOR" == "red" -a "$FIRST_LINE_HEALTH" != "DEGRADED" ] && FIRST_LINE_HEALTH="FAULTED"
   [ "$CAP_COLOR" == "yellow" -a "$FIRST_LINE_CAP" != "full" ] && FIRST_LINE_CAP="nearly full"   [ "$CAP_COLOR" == "yellow" -a "$FIRST_LINE_CAP" != "full" ] && FIRST_LINE_CAP="nearly full"
   [ "$CAP_COLOR" = "yellow" ] && FIRST_LINE_CAP="full"   [ "$CAP_COLOR" = "yellow" ] && FIRST_LINE_CAP="full"
Line 112: Line 124:
   [ "$LINE_COLOR" == "red" ] && DISPCOLOR="red"   [ "$LINE_COLOR" == "red" ] && DISPCOLOR="red"
  
-  STRING="$STRING <tr><td>&${LINE_COLOR}</td><td>${name}</td><td>${health}</td><td>${cap} %</td></tr>"+STRING="$STRING <tr><td>&${LINE_COLOR}</td><td>${name}</td><td>${health}</td><td>${alloc}</td><td>${free}</td><td>${cap} %</td></tr>"
 done done
-DATA=$(/usr/bin/echo "$DATA \n\n")+DATA=$(echo "$DATA \n\n")
  
 STRING="$STRING </table><br><br>" STRING="$STRING </table><br><br>"
-STRING="$STRING`/usr/sbin/zpool status -xv`" +STRING="$STRING`zpool status`" 
-FIRST_LINE="zfs - health: $FIRST_LINE_HEALTH - capacity: $FIRST_LINE_CAP"+FIRST_LINE="zfs - Health Report: $FIRST_LINE_HEALTH - Capacity Report: $FIRST_LINE_CAP"
  
 # Snapshot check # Snapshot check
Line 187: Line 199:
   * **2013-07-16**   * **2013-07-16**
     * Changed graphing FNPATTERN to **^**zfs,(.*).rrd\\ Without the ^ it will pick up and try and graph any rrd file with the string "zfs," in the file name.      * Changed graphing FNPATTERN to **^**zfs,(.*).rrd\\ Without the ^ it will pick up and try and graph any rrd file with the string "zfs," in the file name. 
 +  * **2020-04-20**
 +    * Update to new "zpool list -h" format
 +    * Add Available/Free to table
 +    * Full "zpool status" always displayed
 +    * Set DEGRADED=RED
 +    * DISKYELL=90 & DISKRED=95
  • monitors/bb-zfs.txt
  • Last modified: 2020/04/21 01:11
  • by freesoftwareservers