check_snmp_netint.pl syntax help [SOLVED]

I’m trying to get this check to tell me if any of my access ports have stp disabled. (we’ve had some problems with loops in our network). Freaking Nortel/Avaya - you make a vlan change and it disabled spanning tree!

So here is what I have so far.

./check_snmp_netint.pl -v 2c -C communitystring -H ip.addr -N 1.3.6.1.2.1.17.2.15.1.3 --stp -n 1 -v
Alarm at 10 + 5
SNMP v1 login
Filter : 1
OID : 1.3.6.1.2.1.17.2.15.1.3.145, Desc : 5
OID : 1.3.6.1.2.1.17.2.15.1.3.176, Desc : 1
OID : 1.3.6.1.2.1.17.2.15.1.3.299, Desc : 5
OID : 1.3.6.1.2.1.17.2.15.1.3.142, Desc : 5
OID : 1.3.6.1.2.1.17.2.15.1.3.48, Desc : 1
Name : 1, Index : 176
Name : 1, Index : 48
1:UP [STP:disabled], 1:UP [STP:disabled]:(2 UP): OK |  '1_stp_state'=1 '1_stp_changetime'=1301584015  '1_stp_state'=1 '1_stp_changetime'=1301584015

As you can see from the output above, two ports have STP disabled. But because they are UP, this check says OK. I want it to say, WARNING or CRITICAL.

So I look through the options and I see the -w, etc. but that doesn’t seem to do what I want it to.

Can anyone help me out here?
Options:

root@nagios:/usr/local/nagios/libexec# ./check_snmp_netint.pl 
Usage: ./check_snmp_netint.pl -v] -H <host> (-C <snmp_community> -2]) | (-l login -x passwd -X pass -L <authp>,<privp>)  -p <port>] -N <desc table oid>] -n <name in desc_oid> -O <comments table OID>] -i | -a | -D] -r] -f[eSyYZ] -P <previous perf data from nagios $SERVICEPERFDATA$>] -T <previous time from nagios $LASTSERVICECHECK$>] --pcount=<hist size in perf>]] -k[qBMGu] -S [intspeed]] -g -w<warn levels> -c<crit levels> -d<delta>] -o <octet_length>] -m|-mm] -t <timeout>] -s] --label] --cisco=[oper,][addoper,][linkfault,][use_portnames|show_portnames]] --stp=<expected stp state>]] -V]
root@nagios:/usr/local/nagios/libexec# 

For those who are looking to be notified when your access ports have STP disabled:

I found a way around this by using check_snmpwalk.sh

./check_snmpwalk.sh 10.1.56.235 3 3 “STP” .1.3.6.1.4.1.2272.1.13.5.1.4 5

notice there isn’t a community string. I guess you can only use version 1/2c. The community string would need to be in your snmp.conf file. Now I have to figure out how to use snmpv3 for this service check, cause I don’t allow 1/2c in my network.

3 3 is actually warning critical (i don’t care about warning, i care about critical…so they’re the same.)
“STP” is the name of the service-which could be anything
.1.3…4 is the snmptable oid for rcStgPortState
5 is the normal value (basically it means, don’t look here). 5 is “forwarding”

I care about 1’s (disabled). So it adds all the 1’s, if more than 3 it’s Critical.

We disable STP on our Trunks so there will always be 2 ports with it disabled. So if the number is greater than 2, i want to know.