<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Monitor total cluster utilization via SNMP on Nagios in StoreVirtual Storage</title>
    <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501593#M389</link>
    <description>I'm not the "forums police", but if you don't mind....&lt;BR /&gt;&lt;BR /&gt;you can put the script in a .TXT file and attach it.&lt;BR /&gt;That retains its formatting and keeps the thread 'shorter' for reading the explanation.&lt;BR /&gt;Thanks.</description>
    <pubDate>Thu, 05 May 2011 12:11:06 GMT</pubDate>
    <dc:creator>Uwe Zessin</dc:creator>
    <dc:date>2011-05-05T12:11:06Z</dc:date>
    <item>
      <title>Monitor total cluster utilization via SNMP on Nagios</title>
      <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501590#M386</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;&lt;BR /&gt;Graph Label: Lefthand Cluster Utilization&lt;BR /&gt;Service: nsm_clust_utilization_&lt;BR /&gt;Use Service as a Regular Expression ON&lt;BR /&gt;Host: *&lt;BR /&gt;Status Text Parsing Regular Expression: SNMP OK - (\d+)\s+(\d+)\s+(\d+)&lt;BR /&gt;Use Status Text Parsing instead of Performance Data OFF&lt;BR /&gt;RRD Name /usr/local/groundwork/rrd/$HOST$_$SERVICE$.rrd&lt;BR /&gt;RRD Create Command $RRDTOOL$ create $RRDNAME$ --step 300 --start n-1yr DS:clustersize:GAUGE:1800:U:U DS:available:GAUGE:1800:U:U DS:warning:GAUGE:1800:U:U DS:critical:GAUGE:1800:U:U DS:provisioned:GAUGE:1800:U:U RRA:AVERAGE:0.5:1:8640 RRA:AVERAGE:0.5:12:9480&lt;BR /&gt;RRD Update Command $RRDTOOL$ update $RRDNAME$ -t clustersize:available:warning:critical:provisioned $LASTCHECK$:$VALUE1$:$VALUE2$:$VALUE3$:$VALUE4$:$VALUE5$ 2&amp;gt;&amp;amp;1&lt;BR /&gt;Custom RRDtool Graph Command ''&lt;BR /&gt;Enable ON&lt;BR /&gt;&lt;BR /&gt;Check_command: check_nsm_clus_util&lt;BR /&gt;$USER1$/check_lhcluster.sh $HOSTADDRESS$ $USER7$ $ARG1$ $ARG2$ $ARG3$ &lt;BR /&gt;&lt;BR /&gt;ARG1=warning threshold&lt;BR /&gt;ARG2=critical threshold&lt;BR /&gt;ARG3=# of Cluster (in management group)&lt;BR /&gt;&lt;BR /&gt;usage: check_nsm_clus_util!94!98!1&lt;BR /&gt;&lt;BR /&gt;results:&lt;BR /&gt;OK - "LHProdClust01" is 15.00 % free | clustersize=8233 available=1251 warning=7739 critical=8068 provisioned=6982&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;example of check_lhcluster.sh:&lt;BR /&gt;&lt;BR /&gt;#! /bin/sh &lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;STATE_OK=$(expr 0)&lt;BR /&gt;STATE_WARNING=$(expr 1)&lt;BR /&gt;STATE_CRITICAL=$(expr 2)&lt;BR /&gt;STATE_UNKNOWN=$(expr 3)&lt;BR /&gt;CLUSTERINSTANCE=$5&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;RET=$? &lt;BR /&gt;if [[ $RET -ne 0 ]] &lt;BR /&gt;then &lt;BR /&gt;echo "query problem - No data received from host" &lt;BR /&gt;exit $STATE_UNKNOWN &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;# figure out the name of the cluster for instance supplied on command line&lt;BR /&gt;clustername=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterName.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "Clustername=$clustername"&lt;BR /&gt;&lt;BR /&gt;# total number of modules in management group&lt;BR /&gt;totalmodules=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleCount.0|cut -d" " -f4)&lt;BR /&gt;#echo "totalmodules=$totalmodules"&lt;BR /&gt;&lt;BR /&gt;# total number of modules in this particular cluster&lt;BR /&gt;clustermodules=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterModuleCount.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "clustermodules=$clustermodules"&lt;BR /&gt;&lt;BR /&gt;checkcount=0&lt;BR /&gt;&lt;BR /&gt;#cycle through each module.  Get the totalsize, check only those who match our clustername, then find the smallest sized module in our cluster, multiply it by&lt;BR /&gt;# the number of modules in our cluster - that should give us our total cluster capacity.&lt;BR /&gt;while [ "$checkcount" -lt $totalmodules ]&lt;BR /&gt;do&lt;BR /&gt;ck=$(echo $checkcount + 1 | bc)&lt;BR /&gt;&lt;BR /&gt;ibelongto=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleClusterName.$ck|cut -d" " -f4)&lt;BR /&gt;&lt;BR /&gt;#echo "does $ibelongto equal $clustername ? "&lt;BR /&gt;if [ "$ibelongto" = "$clustername" ] ; then&lt;BR /&gt;&lt;BR /&gt;modtotal=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleTotalSize.$ck|cut -d" " -f4)&lt;BR /&gt;&lt;BR /&gt;modtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;if [ checkmodtota=0 ] ; then &lt;BR /&gt;checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;fi&lt;BR /&gt;# echo "Check to see if $modtotal is -le $checkmodtotal"&lt;BR /&gt; if [ $modtotal -le $checkmodtotal ] ; then&lt;BR /&gt;   checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;#echo "setting total to $checkmodtotal"&lt;BR /&gt; fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#echo "checkmodtotal is $checkmodtotal"&lt;BR /&gt;checkcount=$(($checkcount+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;# How many volumes are in this management group?  Let's cycle through them all and count the used space of the volume, and its snapshots (but only&lt;BR /&gt;# if they belong to OUR cluster:&lt;BR /&gt;numbervolumes=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeCount.0|cut -d" " -f4)&lt;BR /&gt;#echo "Total Volumes in this Management Group is $numbervolumes"&lt;BR /&gt;&lt;BR /&gt;addvolumes=1&lt;BR /&gt;totalused=0&lt;BR /&gt;while [ "$addvolumes" -le $numbervolumes ]&lt;BR /&gt;do&lt;BR /&gt;ibelongto=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeClusterName.$addvolumes|cut -d" " -f4)&lt;BR /&gt;if [ "$ibelongto" = "$clustername" ] ; then&lt;BR /&gt;#echo "Sure does... check replication level, then look to see if there are snapshots"&lt;BR /&gt;repllevel=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeReplicaCount.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "Got a rep level of $repllevel"&lt;BR /&gt;snapcount=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeSnapshotCount.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "found $snapcount snapshots"&lt;BR /&gt;snapcheck=1&lt;BR /&gt;# get the used space of the volume for now.&lt;BR /&gt;thisvolumeprov=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeProvisionedSpace.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "non snap size is $thisvolumeprov"&lt;BR /&gt;# now cycle through all the snapshots, and add their used space together&lt;BR /&gt;while [ "$snapcheck" -le $snapcount ]&lt;BR /&gt;do&lt;BR /&gt;thissnapprov=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeSnapshotProvisionedSpace.$addvolumes.$snapcheck|cut -d" " -f4)&lt;BR /&gt;#echo "bare snap is $thissnapprov - now add volume plus snapshot"&lt;BR /&gt;thisvolumeprov=$(echo "$thisvolumeprov + $thissnapprov" | bc)&lt;BR /&gt;#echo "This volumes size so far is $thisvolumeprov"&lt;BR /&gt;snapcheck=$(($snapcheck+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;repllevel=$(echo "$repllevel / 1" | bc)&lt;BR /&gt;#thisvolumeprov=$(echo "$repllevel * $thisvolumeprov" | bc)&lt;BR /&gt;totalused=$(echo "$totalused + $thisvolumeprov" | bc)&lt;BR /&gt;dispgb=$(echo "$thisvolumeprov/1024" | bc)&lt;BR /&gt;dispgb=$(echo "$dispgb/1024" | bc)&lt;BR /&gt;#echo "thisvolume=$dispgb ($repllevel way replication)"&lt;BR /&gt;fi&lt;BR /&gt;addvolumes=$(($addvolumes+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#echo "done checking volumes - let's total it up!"&lt;BR /&gt;# Lefthand SNMP reports usage in KB, so divide by 1024&lt;BR /&gt;totalused=$(echo "$totalused / 1024" | bc)&lt;BR /&gt;#echo "total MB $totalused"&lt;BR /&gt;&lt;BR /&gt;# now divide by 1024 to convert MB to GB&lt;BR /&gt;totalused=$(echo "$totalused / 1024" | bc)&lt;BR /&gt;#echo "total GB $totalused"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;clustertotal=$(echo "$checkmodtotal * $clustermodules" | bc)&lt;BR /&gt;#echo "clustertotal=$clustertotal"&lt;BR /&gt;&lt;BR /&gt;# There's some overhead to the cluster total due to formating etc etc.  Dunno if this is scientific, but this number seemed&lt;BR /&gt;# to give me a relatively accurate clustersize across a few different builds, so I'm gonna run with .9845&lt;BR /&gt;clustertotal=$(echo "$clustertotal * .9845" | bc)&lt;BR /&gt;clustertotal=$(echo "$clustertotal/1" | bc)&lt;BR /&gt;#echo "newclustertotal=$clustertotal"&lt;BR /&gt;&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;#echo "clustertotal in GB = $clustertotal"&lt;BR /&gt;&lt;BR /&gt;clusteravail=$(echo $clustertotal - $totalused | bc)&lt;BR /&gt;#echo "clusteravail=$clusteravail"&lt;BR /&gt;&lt;BR /&gt;# calculate the current percentage free of the cluster&lt;BR /&gt;percentfree=$(echo "scale=2; $clusteravail/$clustertotal " |bc)&lt;BR /&gt;#echo "percentfree=$percentfree"&lt;BR /&gt;&lt;BR /&gt;wp=$(echo "scale=2; .01*$3" | bc)&lt;BR /&gt;cp=$(echo "scale=2; .01*$4" | bc)&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the warning threshhold:&lt;BR /&gt;wt=$(echo "scale=10; $clustertotal * $wp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;wt=$(echo "$wt /1" | bc)&lt;BR /&gt;#echo "the wt is $wt"&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the critical threshhold:&lt;BR /&gt;ct=$(echo "scale=2; $clustertotal * $cp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;ct=$(echo "$ct /1" | bc)&lt;BR /&gt;#echo "the ct is $ct"&lt;BR /&gt;&lt;BR /&gt;#echo "wp=$wp"&lt;BR /&gt;#echo "ct=$ct"&lt;BR /&gt;#echo "wt= $wt"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cu=$(expr $clustertotal - $clusteravail)&lt;BR /&gt;&lt;BR /&gt;percentfree=$(echo "$percentfree*100" | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; if [ $cu -ge $ct ] ; then&lt;BR /&gt;  echo "CRITICAL - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;  exit $STATE_CRITICAL&lt;BR /&gt;&lt;BR /&gt; elif [ $cu -le $wt ] ; then&lt;BR /&gt;    echo "OK - $clustername is $percentfree % free | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;   exit $STATE_OK&lt;BR /&gt;&lt;BR /&gt; elif [ $cu -gt $wt ] ; then&lt;BR /&gt;    echo "WARNING - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;  exit $STATE_WARNING&lt;BR /&gt;&lt;BR /&gt;  else&lt;BR /&gt; echo "problem - No data received from host" &lt;BR /&gt;   exit $STATE_UNKNOWN&lt;BR /&gt; fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2009 15:38:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501590#M386</guid>
      <dc:creator>teledata</dc:creator>
      <dc:date>2009-09-22T15:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor total cluster utilization via SNMP on Nagios</title>
      <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501591#M387</link>
      <description>Thanks for the massive assist in getting some basic SNMP checking working Teledata. I have fixed some bugs and have this check working again and ready to plug into Icinga.&lt;BR /&gt;&lt;BR /&gt;I am a bit worried about the maths involved though and I am now working on rewriting this from scratch. None the less its a huge help.&lt;BR /&gt;&lt;BR /&gt;Updated version below;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;# Credit to Teledata for the initial script at &lt;A href="http://forums11.itrc.hp.com/service/forums/postanswer.do?threadid=1373346&amp;amp;forumId=1&amp;amp;closedFlag=0" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/postanswer.do?threadid=1373346&amp;amp;forumId=1&amp;amp;closedFlag=0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;# Updated by Sam Wilson kahn@the-mesh.org&lt;BR /&gt;# Fixed deprecated cluster size OID&lt;BR /&gt;# Made using nagios, icinga, groundworks easier&lt;BR /&gt;# $Id: check_lh_cluster.sh 209 2011-05-05 04:08:21Z swilson $&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;STATE_OK=$(expr 0)&lt;BR /&gt;STATE_WARNING=$(expr 1)&lt;BR /&gt;STATE_CRITICAL=$(expr 2)&lt;BR /&gt;STATE_UNKNOWN=$(expr 3)&lt;BR /&gt;CLUSTERINSTANCE=$5&lt;BR /&gt;LIBEXEC="/usr/local/icinga/libexec"&lt;BR /&gt;&lt;BR /&gt;RET=$?&lt;BR /&gt;if [[ $RET -ne 0 ]]&lt;BR /&gt;then&lt;BR /&gt;echo "query problem - No data received from host"&lt;BR /&gt;exit $STATE_UNKNOWN&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# figure out the name of the cluster for instance supplied on command line&lt;BR /&gt;clustername=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterName.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "Clustername=$clustername"&lt;BR /&gt;&lt;BR /&gt;# total number of modules in management group&lt;BR /&gt;totalmodules=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleCount.0|cut -d" " -f4)&lt;BR /&gt;#echo "totalmodules=$totalmodules"&lt;BR /&gt;&lt;BR /&gt;# total number of modules in this particular cluster&lt;BR /&gt;clustermodules=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterModuleCount.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "clustermodules=$clustermodules"&lt;BR /&gt;&lt;BR /&gt;checkcount=0&lt;BR /&gt;&lt;BR /&gt;#cycle through each module.  Get the totalsize, check only those who match our clustername, then find the smallest sized module in our cluster, multiply it by&lt;BR /&gt;# the number of modules in our cluster - that should give us our total cluster capacity.&lt;BR /&gt;while [ "$checkcount" -lt $totalmodules ]&lt;BR /&gt;do&lt;BR /&gt;ck=$(echo $checkcount + 1 | bc)&lt;BR /&gt;&lt;BR /&gt;ibelongto=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleClusterName.$ck|cut -d" " -f4)&lt;BR /&gt;&lt;BR /&gt;#echo "does $ibelongto equal $clustername?"&lt;BR /&gt;if [ "$ibelongto" = "$clustername" ] ; then&lt;BR /&gt;&lt;BR /&gt;modtotal=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleUsableSpace.$ck|cut -d" " -f4)&lt;BR /&gt;&lt;BR /&gt;modtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;#echo "stdin errors above...."&lt;BR /&gt;&lt;BR /&gt;if [ checkmodtotal=0 ] ; then&lt;BR /&gt;checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;fi&lt;BR /&gt;#echo "Check to see if $modtotal is -le $checkmodtotal"&lt;BR /&gt;if [ $modtotal -le $checkmodtotal ] ; then&lt;BR /&gt;   checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;#echo "setting total to $checkmodtotal"&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#echo "checkmodtotal is $checkmodtotal"&lt;BR /&gt;checkcount=$(($checkcount+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;# How many volumes are in this management group?  Let's cycle through them all and count the used space of the volume, and its snapshots (but only&lt;BR /&gt;# if they belong to OUR cluster:&lt;BR /&gt;numbervolumes=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeCount.0|cut -d" " -f4)&lt;BR /&gt;#echo "Total Volumes in this Management Group is $numbervolumes"&lt;BR /&gt;&lt;BR /&gt;addvolumes=1&lt;BR /&gt;totalused=0&lt;BR /&gt;while [ "$addvolumes" -le $numbervolumes ]&lt;BR /&gt;do&lt;BR /&gt;ibelongto=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeClusterName.$addvolumes|cut -d" " -f4)&lt;BR /&gt;if [ "$ibelongto" = "$clustername" ] ; then&lt;BR /&gt;#echo "Sure does... check replication level, then look to see if there are snapshots"&lt;BR /&gt;repllevel=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeReplicaCount.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "Got a rep level of $repllevel"&lt;BR /&gt;snapcount=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeSnapshotCount.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "found $snapcount snapshots"&lt;BR /&gt;snapcheck=1&lt;BR /&gt;# get the used space of the volume for now.&lt;BR /&gt;thisvolumeprov=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeProvisionedSpace.$addvolumes|cut -d" " -f4)&lt;BR /&gt;#echo "non snap size is $thisvolumeprov"&lt;BR /&gt;# now cycle through all the snapshots, and add their used space together&lt;BR /&gt;while [ "$snapcheck" -le $snapcount ]&lt;BR /&gt;do&lt;BR /&gt;thissnapprov=$($LIBEXEC/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusVolumeSnapshotProvisionedSpace.$addvolumes.$snapcheck|cut -d" " -f4)&lt;BR /&gt;#echo "bare snap is $thissnapprov - now add volume plus snapshot"&lt;BR /&gt;thisvolumeprov=$(echo "$thisvolumeprov + $thissnapprov" | bc)&lt;BR /&gt;#echo "This volumes size so far is $thisvolumeprov"&lt;BR /&gt;snapcheck=$(($snapcheck+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;repllevel=$(echo "$repllevel / 1" | bc)&lt;BR /&gt;#thisvolumeprov=$(echo "$repllevel * $thisvolumeprov" | bc)&lt;BR /&gt;totalused=$(echo "$totalused + $thisvolumeprov" | bc)&lt;BR /&gt;dispgb=$(echo "$thisvolumeprov/1024" | bc)&lt;BR /&gt;dispgb=$(echo "$dispgb/1024" | bc)&lt;BR /&gt;#echo "thisvolume=$dispgb ($repllevel way replication)"&lt;BR /&gt;fi&lt;BR /&gt;addvolumes=$(($addvolumes+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#echo "done checking volumes - let's total it up!"&lt;BR /&gt;# Lefthand SNMP reports usage in KB, so divide by 1024&lt;BR /&gt;totalused=$(echo "$totalused / 1024" | bc)&lt;BR /&gt;#echo "total MB $totalused"&lt;BR /&gt;&lt;BR /&gt;# now divide by 1024 to convert MB to GB&lt;BR /&gt;totalused=$(echo "$totalused / 1024" | bc)&lt;BR /&gt;#echo "total GB $totalused"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;clustertotal=$(echo "$checkmodtotal * $clustermodules" | bc)&lt;BR /&gt;#echo "clustertotal=$clustertotal"&lt;BR /&gt;&lt;BR /&gt;# There's some overhead to the cluster total due to formating etc etc.  Dunno if this is scientific, but this number seemed&lt;BR /&gt;# to give me a relatively accurate clustersize across a few different builds, so I'm gonna run with .9845&lt;BR /&gt;clustertotal=$(echo "$clustertotal * .9845" | bc)&lt;BR /&gt;clustertotal=$(echo "$clustertotal/1" | bc)&lt;BR /&gt;#echo "newclustertotal=$clustertotal"&lt;BR /&gt;&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;#echo "clustertotal in GB = $clustertotal"&lt;BR /&gt;&lt;BR /&gt;clusteravail=$(echo $clustertotal - $totalused | bc)&lt;BR /&gt;#echo "clusteravail=$clusteravail"&lt;BR /&gt;&lt;BR /&gt;# calculate the current percentage free of the cluster&lt;BR /&gt;percentfree=$(echo "scale=2; $clusteravail/$clustertotal " |bc)&lt;BR /&gt;#echo "percentfree=$percentfree"&lt;BR /&gt;&lt;BR /&gt;wp=$(echo "scale=2; .01*$3" | bc)&lt;BR /&gt;cp=$(echo "scale=2; .01*$4" | bc)&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the warning threshhold:&lt;BR /&gt;wt=$(echo "scale=10; $clustertotal * $wp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;wt=$(echo "$wt /1" | bc)&lt;BR /&gt;#echo "the wt is $wt"&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the critical threshhold:&lt;BR /&gt;ct=$(echo "scale=2; $clustertotal * $cp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;ct=$(echo "$ct /1" | bc)&lt;BR /&gt;#echo "the ct is $ct"&lt;BR /&gt;&lt;BR /&gt;#echo "wp=$wp"&lt;BR /&gt;#echo "ct=$ct"&lt;BR /&gt;#echo "wt= $wt"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cu=$(expr $clustertotal - $clusteravail)&lt;BR /&gt;&lt;BR /&gt;percentfree=$(echo "$percentfree*100" | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [ $cu -ge $ct ] ; then&lt;BR /&gt;  echo "CRITICAL - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;  exit $STATE_CRITICAL&lt;BR /&gt;&lt;BR /&gt;elif [ $cu -le $wt ] ; then&lt;BR /&gt;    echo "OK - $clustername is $percentfree % free | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;   exit $STATE_OK&lt;BR /&gt;&lt;BR /&gt;elif [ $cu -gt $wt ] ; then&lt;BR /&gt;    echo "WARNING - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused"&lt;BR /&gt;  exit $STATE_WARNING&lt;BR /&gt;&lt;BR /&gt;  else&lt;BR /&gt;#echo "problem - No data received from host"&lt;BR /&gt;   exit $STATE_UNKNOWN&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 May 2011 03:09:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501591#M387</guid>
      <dc:creator>ictcths</dc:creator>
      <dc:date>2011-05-05T03:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor total cluster utilization via SNMP on Nagios</title>
      <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501592#M388</link>
      <description>Aaah, that was my first stab at the cluster size query.&lt;BR /&gt;&lt;BR /&gt;I have a newer version that I created.  It uses some counters that were introduced in later version of SAN/iQ.  It is simplified, and takes much less time to run. (it no longer has  to cycle through all the volumes) I think you have to be running 8.5 or newer (maybe 9, I can't remember).  Anyway, here's the code:&lt;BR /&gt;&lt;BR /&gt;#! /bin/sh &lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;STATE_OK=$(expr 0)&lt;BR /&gt;STATE_WARNING=$(expr 1)&lt;BR /&gt;STATE_CRITICAL=$(expr 2)&lt;BR /&gt;STATE_UNKNOWN=$(expr 3)&lt;BR /&gt;CLUSTERINSTANCE=$5&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;RET=$? &lt;BR /&gt;if [[ $RET -ne 0 ]] &lt;BR /&gt;then &lt;BR /&gt;echo "query problem - No data received from host" &lt;BR /&gt;exit $STATE_UNKNOWN &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;# figure out the name of the cluster for instance supplied on command line&lt;BR /&gt;clustername=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterName.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "Clustername=$clustername"&lt;BR /&gt;&lt;BR /&gt;# figure out Available Space&lt;BR /&gt;clusteravail=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterAvailableSpace.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# total number of modules in management group&lt;BR /&gt;totalmodules=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleCount.0|cut -d" " -f4)&lt;BR /&gt;#echo "totalmodules=$totalmodules"&lt;BR /&gt;&lt;BR /&gt;# total number of modules in this particular cluster&lt;BR /&gt;clustermodules=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusClusterModuleCount.$CLUSTERINSTANCE|cut -d" " -f4)&lt;BR /&gt;#echo "clustermodules=$clustermodules"&lt;BR /&gt;&lt;BR /&gt;checkcount=0&lt;BR /&gt;&lt;BR /&gt;#cycle through each module.  Get the totalsize, check only those who match our clustername, then find the smallest sized module in our cluster, multiply it by&lt;BR /&gt;# the number of modules in our cluster - that should give us our total cluster capacity.&lt;BR /&gt;while [ "$checkcount" -lt $totalmodules ]&lt;BR /&gt;do&lt;BR /&gt;ck=$(echo $checkcount + 1 | bc)&lt;BR /&gt;&lt;BR /&gt;#echo "checking $ck"&lt;BR /&gt;ibelongto=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleClusterName.$ck|cut -d" " -f4)&lt;BR /&gt;#echo "ibelongto is $ibelongto"&lt;BR /&gt;&lt;BR /&gt;#echo "does $ibelongto equal $clustername ? "&lt;BR /&gt;if [ "$ibelongto" = "$clustername" ] ; then&lt;BR /&gt;&lt;BR /&gt;modtotal=$(/usr/local/groundwork/nagios/libexec/check_snmp -P 2c -H $1 -C $2 -o LEFTHAND-NETWORKS-NSM-CLUSTERING-MIB::clusModuleUsableSpace.$ck|cut -d" " -f4)&lt;BR /&gt;#echo "modtotal is $modtotal"&lt;BR /&gt;modtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;if [ checkmodtotal=0 ] ; then &lt;BR /&gt;checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# echo "Check to see if $modtotal is -le $checkmodtotal"&lt;BR /&gt; if [ $modtotal -le $checkmodtotal ] ; then&lt;BR /&gt;   checkmodtotal=$(echo "$modtotal" | bc)&lt;BR /&gt;# echo "setting total to $checkmodtotal"&lt;BR /&gt; fi&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#echo "checkmodtotal is $checkmodtotal"&lt;BR /&gt;checkcount=$(($checkcount+1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;clustertotal=$(echo "$checkmodtotal * $clustermodules" | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#convert to MB&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;clusteravail=$(echo "$clusteravail / 1024" | bc)&lt;BR /&gt;&lt;BR /&gt;#convert to GB&lt;BR /&gt;clustertotal=$(echo "$clustertotal / 1024" | bc)&lt;BR /&gt;clusteravail=$(echo "$clusteravail / 1024" | bc)&lt;BR /&gt;totalused=$(echo "$clustertotal - $clusteravail" |bc)&lt;BR /&gt;&lt;BR /&gt;# calculate the current percentage free of the cluster&lt;BR /&gt;percentfree=$(echo "scale=2; $clusteravail/$clustertotal " |bc)&lt;BR /&gt;#echo "percentfree=$percentfree"&lt;BR /&gt;&lt;BR /&gt;wp=$(echo "scale=2; .01*$3" | bc)&lt;BR /&gt;cp=$(echo "scale=2; .01*$4" | bc)&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the warning threshhold:&lt;BR /&gt;wt=$(echo "scale=10; $clustertotal * $wp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;wt=$(echo "$wt /1" | bc)&lt;BR /&gt;#echo "the wt is $wt"&lt;BR /&gt;&lt;BR /&gt;# calculate the GB that equals the critical threshhold:&lt;BR /&gt;ct=$(echo "scale=2; $clustertotal * $cp" | bc)&lt;BR /&gt;# get rid of the decimal places that bash can't deal with&lt;BR /&gt;ct=$(echo "$ct /1" | bc)&lt;BR /&gt;#echo "the ct is $ct"&lt;BR /&gt;&lt;BR /&gt;#echo "wp=$wp"&lt;BR /&gt;#echo "ct=$ct"&lt;BR /&gt;#echo "wt= $wt"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cu=$(expr $clustertotal - $clusteravail)&lt;BR /&gt;&lt;BR /&gt;percentfree=$(echo "$percentfree*100" | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; if [ $cu -ge $ct ] ; then&lt;BR /&gt;  echo "CRITICAL - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused nodes=$clustermodules"&lt;BR /&gt;  exit $STATE_CRITICAL&lt;BR /&gt;&lt;BR /&gt; elif [ $cu -le $wt ] ; then&lt;BR /&gt;    echo "OK - $clustername is $percentfree % free | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused nodes=$clustermodules"&lt;BR /&gt;   exit $STATE_OK&lt;BR /&gt;&lt;BR /&gt; elif [ $cu -gt $wt ] ; then&lt;BR /&gt;    echo "WARNING - *$clustername is $percentfree % free* | clustersize=$clustertotal available=$clusteravail warning=$wt critical=$ct provisioned=$totalused nodes=$clustermodules"&lt;BR /&gt;  exit $STATE_WARNING&lt;BR /&gt;&lt;BR /&gt;  else&lt;BR /&gt; echo "problem - No data received from host" &lt;BR /&gt;   exit $STATE_UNKNOWN&lt;BR /&gt; fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 May 2011 12:07:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501592#M388</guid>
      <dc:creator>teledata</dc:creator>
      <dc:date>2011-05-05T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor total cluster utilization via SNMP on Nagios</title>
      <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501593#M389</link>
      <description>I'm not the "forums police", but if you don't mind....&lt;BR /&gt;&lt;BR /&gt;you can put the script in a .TXT file and attach it.&lt;BR /&gt;That retains its formatting and keeps the thread 'shorter' for reading the explanation.&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 05 May 2011 12:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/4501593#M389</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2011-05-05T12:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor total cluster utilization via SNMP on Nagios</title>
      <link>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/5481575#M4371</link>
      <description>&lt;P&gt;hi i used your script but it didn't and the same result is with teledata's, first it was error on line 41 and now it is error on line 43!&lt;/P&gt;&lt;P&gt;i have hp left hand 4300 and here is the command i used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;./check_lefthand.sh 10.1.1.215 snmp 94 98 1&lt;/P&gt;&lt;P&gt;reusult:&lt;/P&gt;&lt;P&gt;./check_lefthand.sh: line 43: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 43: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 90: [: 1: unary operator expected&lt;BR /&gt;./check_lefthand.sh: line 99: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 101: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 102: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 103: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 111: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 115: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 119: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 124: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 125: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 128: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 129: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 132: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 136: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 139: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 140: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 143: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 145: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 149: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 151: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 161: bc: command not found&lt;BR /&gt;./check_lefthand.sh: line 164: [: -: unary operator expected&lt;BR /&gt;./check_lefthand.sh: line 168: [: -: unary operator expected&lt;BR /&gt;./check_lefthand.sh: line 172: [: -: unary operator expected&lt;BR /&gt;any idea of what is wrong?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2012 06:41:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/storevirtual-storage/monitor-total-cluster-utilization-via-snmp-on-nagios/m-p/5481575#M4371</guid>
      <dc:creator>Majed17</dc:creator>
      <dc:date>2012-01-12T06:41:18Z</dc:date>
    </item>
  </channel>
</rss>

