First you will need to make sure SNMP is installed.
apt-get install snmpd snmp snmp-mibs-downloader
You’ll need to configure a new snmpd.conf file with
Run through the steps and when your done replace your current snmpd.conf file in /etc/snmp/ with the new one.
Now open up your new snmpd.conf file
and add the following to the bottom of the file.
extend myshscript /path/to/your.sh
Save and close the file and restart the snmpd service.
service snmpd restart
Now we need to find the OID of our new data point. Do this by running
snmpwalk -v2c -c public localhost .126.96.36.199.4.1.8072.1.3.2
It should display something similar to the following.
root@localhost:/etc/snmp# snmpwalk -v2c -c public localhost .188.8.131.52.4.1.8072.1.3.2 iso.184.108.40.206.1.8072.1.3.2.1.0 = INTEGER: 1 iso.220.127.116.11.1.8072.1.3.2.18.104.22.168.22.214.171.124 = STRING: "/etc/snmp/volt.sh" iso.126.96.36.199.1.8072.1.3.2.188.8.131.52.184.108.40.206 = INTEGER: 0 iso.220.127.116.11.1.8072.1.3.2.18.104.22.168.22.214.171.124.1 = STRING: "14.3" root@localhost:/etc/snmp#
The OID we are interested in is the one on the last line. If you run a snmpwalk command with the OID you should get your data point.
root@localhost:/etc/snmp# snmpwalk -v2c -c public localhost 126.96.36.199.4.1.8072.1.3.2.188.8.131.52.184.108.40.206.1 iso.220.127.116.11.1.8072.1.3.2.18.104.22.168.22.214.171.124.1 = STRING: "14.3" root@localhost:/etc/snmp#
All that’s left is to add the OID to your SNMP monitor. If You run into issues with your SNMP server not monitoring the OID, you might need do what I did in the above command, replace the beginning of the OID “iso.” with a “1”.