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 .184.108.40.206.4.1.8072.1.3.2
It should display something similar to the following.
root@localhost:/etc/snmp# snmpwalk -v2c -c public localhost .220.127.116.11.4.1.8072.1.3.2 iso.18.104.22.168.1.8072.1.3.2.1.0 = INTEGER: 1 iso.22.214.171.124.1.8072.1.3.2.126.96.36.199.188.8.131.52 = STRING: "/etc/snmp/volt.sh" iso.184.108.40.206.1.8072.1.3.2.220.127.116.11.18.104.22.168 = INTEGER: 0 iso.22.214.171.124.1.8072.1.3.2.126.96.36.199.188.8.131.52.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 184.108.40.206.4.1.8072.1.3.2.220.127.116.11.18.104.22.168.1 iso.22.214.171.124.1.8072.1.3.2.126.96.36.199.188.8.131.52.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”.