SNMP and Monitoring ZPool's IOPs

Status
Not open for further replies.

Brian Wilson

Cadet
Joined
Aug 22, 2016
Messages
8
FreeNAS Version is 9.3
(Build FreeNAS-9.3-STABLE-201605170422)

I have been trying to figure out how to integrate FreeNAS Appliances into my current monitoring system which is based off Nagios. I've been successful in getting ZPool Status out as well as other general BSD snmp reportable thing like disk usage and the like.


The thing i am most interested in gathering and graphing would be these MIBS
FREENAS-MIB::zfsPoolOpRead1sec.2 = Counter64: 0
FREENAS-MIB::zfsPoolOpWrite1sec.2 = Counter64: 0
FREENAS-MIB::zfsPoolBwWrite1sec.2 = Counter64: 0
FREENAS-MIB::zfsPoolBwRead1sec.2 = Counter64: 0


I am able to poll them however they are returned as a Counter64 which I believe is causing a bit of confusion for the "check_snmp" plugin in nagios. The results return perfomance data appended with a "c"

Example:
Code:
[nagios@MONITORINGHOST libexec]$ ./check_snmp -H IPADDRESS -P 2c -C COMMUNITY -o 1.3.6.1.4.1.25359.1.1.19.2 -m all
SNMP OK - 0 | FREENAS-MIB::zfsPoolOpRead1sec.2=0c



It seems that the counter64 is considered useful for continually increasing value but these specific MIBs are changing every 1 sec.


http://www.muonics.com/Docs/MIBSmithy/UserGuide/commonerrors.php#counter64



Does anyone have any experience with how they are gathering this information and making it available as performance data to graph? I have looked at this for a bit now and think if there is nobody out there doing this then i may have to craft some sort of custom check to basically treat the Counter64 objects as Integer object(leave off the c in the performance output specificly).



Thanks
Brian
 
Last edited:

Brian Wilson

Cadet
Joined
Aug 22, 2016
Messages
8
I figured I would post this back in here in case someone else comes along and sees this and might find this useful.


Here is a script i wrote for getting this information out of the Appliance via SNMP and handing into nagios so that its meaningfully able to be graphed.

Code:
while getopts c:h: option

do
  case "${option}"
  in
  c) community=$OPTARG;;
  h) hostaddress=$OPTARG;;
  esac
done



readiops=$(snmpget -v2c -t 15 -c $community $hostaddress FREENAS-MIB::zfsPoolOpRead1sec.2 | awk '{print $4}')
writeiops=$(snmpget -v2c -t 15 -c $community $hostaddress FREENAS-MIB::zfsPoolOpWrite1sec.2 | awk '{print $4}')
zpoolname=$(snmpget -v2c -t 15 -c $community $hostaddress FREENAS-MIB::zfsPoolName.2 | awk '{print $4}')


echo "OK - No Thresholds - Zpool $zpoolname Read IOPS=$readiops, Write IOPS=$writeiops | riops=$readiops, wiops=$writeiops"
exit 0



The .2 at the End of the Mibs is the 2nd zpool and for my use this is the only one i wanted this info on, you can change that up or make it more extensible if needed.

There are no Thresholds and there is no error checking so i'm sure it can be made better in those regards but it does what i needed in gathering the data from the OID and passing it correctly to performance data for nagios.

Its extensible enough to use -h and -c to allow you to pass in Macros from Nagios Config as well so $HOSTADDRESS$ and $SNMP_COMMUNITY$ can be used to populate the optargs for this when you setup your service_check config for nagios with it.


Thanks
Brian
 
Status
Not open for further replies.
Top