Tuesday, August 14, 2012

add functionality to snmpd to report the output of a script

Add functionality to snmpd to report the output of a script

1. Create the script

cat /usr/local/check_reg.sh

#!/bin/bash
grep uri /var/sipxdata/sipdb/registration.xml | wc -l

2. Add it to snmpd.conf

cat /etc/snmp/snmpd.conf
...
extend check_reg /usr/local/check_reg.sh
....

3. now snmpwalk it
snmpwalk -v2c -c pub localhost NET-SNMP-AGENT-MIB::nsExtensions


No comments: