Custom snmp apc ups

Ok guess I will start with what I would like to accomplish…
would like to run ./check_snmp ... -o 1.3.6.1.4.1.318.1.1.1.1.1.1.0
SNMP OK - “Smart-UPS 2200 RM” |

I would like to if it were a critical run a script afterwards which would shutdown all servers and notify myself and CIO of a power outage at our corporate office.

I have the script wrote up for the shutdown procedure already.

what I cant do is open for edit the check_snmp because of character coding or I would have created it within the script.

So how can I create a plugin that will check snmp for the oid 1.3.6.1.4.1.318.1.1.1.1.1.1.0 and if critical retry every 15 sec. if third time still critical run the script of shutdown.sh?

Thanks in advance & best regards,
Joe

you don’t need to modify check_snmp, look in the docs for “event handlers”.