Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
@genti
Favorites0
Views
Projects0
I only use it to monitor the system health and for that use case it works fine. Although I figured out, that the performance data is in an incorrect format. Between several counters you'll need to have a space to seperate. So by default the output is like this: |SLOT-0/TEMP-1=38;;;SLOT-0/TEMP-2=26;;;SLOT-0/TEMP-3=38;;;SLOT-0/TEMP-4=23;;;FAN-1=9926;;;FAN-2=9782;;; Correct would be: |SLOT-0/TEMP-1=38;;; SLOT-0/TEMP-2=26;;; SLOT-0/TEMP-3=38;;; SLOT-0/TEMP-4=23;;; FAN-1=9926;;; FAN-2=9782;;; Here's a patch, that fixed it for me: https://github.com/pashol/nagios-checks/blob/master/check_snmp_brocade.patch
Reviewed 10 years ago
In case someone is interested. Not perfect, but it does the job. https://github.com/pashol/nagios-checks/blob/master/check_3par_perf if [ $COMMAND == "check_cap_fc" ] then $CONNECTCOMMAND showpd -p -devtype FC -showcols Size_MB,Free_MB -csvtable > $TMPDIR/3par_$COMMAND.$INSERV.out if [ $? -gt 0 ] then echo Could not connect to InServ $INSERV exit 3 fi if [ `tail -1 $TMPDIR/3par_$COMMAND.$INSERV.out` = "No PDs listed" ] then echo No FC disks rm -f $TMPDIR/3par_$COMMAND.$INSERV.out exit 0 fi TOTCAPFC=`cat ${TMPDIR}/3par_${COMMAND}.${INSERV}.out | tail -1 | cut -d, -f1` FREECAPFC=`cat ${TMPDIR}/3par_${COMMAND}.${INSERV}.out | tail -1 | cut -d, -f2` USEDCAPPCFC=`expr 100 - ( ( $FREECAPFC * 100 ) / $TOTCAPFC )` USEDCAPFC=$((($TOTCAPFC-$FREECAPFC))) WARNCAPFCRAW=$(($TOTCAPFC*$PCWARNINGFC/100)) CRITCAPFCRAW=$(($TOTCAPFC*$PCCRITICALFC/100)) if [ $USEDCAPPCFC -ge $PCCRITICALFC ] then echo CRITICAL! Used FC capacity = $USEDCAPPCFC% ( > $PCCRITICALFC% )|UsedSpace=$USEDCAPPCFC%;$PCWARNINGFC;$PCCRITICALFC UsedSpace=$USEDCAPFCMB;$WARNCAPFCRAW;$CRITCAPFCRAW;0;$TOTCAPFC rm -f $TMPDIR/3par_$COMMAND.$INSERV.out exit 2 else if [ $USEDCAPPCFC -ge $PCWARNINGFC ] then echo WARNING! Used FC capacity = $USEDCAPPCFC% ( > $PCWARNINGFC% )|UsedSpace=$USEDCAPPCFC%;$PCWARNINGFC;$PCCRITICALFC UsedSpace=$USEDCAPFCMB;$WARNCAPFCRAW;$CRITCAPFCRAW;0;$TOTCAPFC rm -f $TMPDIR/3par_$COMMAND.$INSERV.out exit 1 else echo OK : Used FC capacity = $USEDCAPPCFC%|UsedSpace=$USEDCAPPCFC%;$PCWARNINGFC;$PCCRITICALFC UsedSpace=$USEDCAPFCMB;$WARNCAPFCRAW;$CRITCAPFCRAW;0;$TOTCAPFC rm -f $TMPDIR/3par_$COMMAND.$INSERV.out exit 0 fi fi fi
I added the magic threshold adaption from check_mk for large disks to the script. https://github.com/pashol/nagios-checks/blob/master/check_win_snmp_disk.pl Documentation for the magic number: https://mathias-kettner.de/checkmk_filesystems.html (Chapter df magic number) I also eliminated the rounding of percentages. For large disks with a narrow warning/critical levels it could potentially cause problems.
The script works perfectly well. Although, I was a bit unhappy with the output. So I changed it slightly. It makes use of Nagios multi line output capabilities and returns all services, that are running. https://github.com/pashol/nagios-checks/blob/master/check_snmp_win.pl