Let
say You have some custom script on Linux You want to monitor in PRTG
Main,
monitor Redis Keys.
nano /etc/snmp/snmpd.conf
Add the script as following to end of the file:
extend redis_keys
/path/to/script.sh
Restart snmpd
/etc/init.d/snmpd restart
Now , we need to find the OID value for our script:
snmptranslate -On
NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"scriptname\"
some times , you need to add mib library to get OID values:
apt-get install snmp-mibs-downloader
In my case , script name is “redis_keys” , so it look like:
snmptranslate -On
NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"redis_keys\"
.1.3.6.1.4.1.8072.1.3.2.3.1.2.10.114.101.100.105.115.95.107.101.121.115
The output is our OID for PRTG:
.1.3.6.1.4.1.8072.1.3.2.3.1.2.10.114.101.100.105.115.95.107.101.121.115
Before deal with PRTG , I want to be sure , my script working
and return value:
snmpwalk -v 2c -c [Community
String] localhost .1.3.6.1.4.1.8072.1.3.2
iso.3.6.1.4.1.8072.1.3.2.4.1.2.10.114.101.100.105.115.95.107.101.121.115= STRING: "/ssd/home/adika/monitor/keys"
Where
[Community String] is You PRTG Community String
No comments:
Post a Comment