HowTo: Configure linux net-smtp to proxy all other snmp calls from custom smtp-ports like squid, apache, etc.
Here is my prtg-monitoring solution for squid-proxy server:
1.) Configure Squid for snmp access
Modify squid.conf (usually /etc/squid3/squid3.conf) and replace all your_ variables with your own values
acl snmp_poll snmp_community your_community_string
snmp_port 3401
snmp_access allow snmp_poll localhost
Restart squid service
2.) Modify Linux Net-SMNP config
Change net-snmp daemon config to proxy all squid snmp calls (usually /etc/snmp/snmpd.conf)
Add the following line to the end of your snmpd.conf (remember to change all your_ variables with your own value(s))
proxy -v 2c -c your_community_string localhost:3401 .1.3.6.1.4.1.3495.1
Restart net-snmpd
Now you should be able to receive all the squids snmp output via standard snmp call on port 161 while using PRTGs standard SNMP sensors. No extra devices, no custom scripting, no workarounds. Clean and easy.
3.) Test:
root@squid-proxy:~# snmpwalk -v 2c -c your_community_string localhost .1.3.6.1.4.1.3495.1
Sample output:
iso.3.6.1.4.1.3495.1.1.1.0 = INTEGER: 240
iso.3.6.1.4.1.3495.1.1.2.0 = INTEGER: 3774872
iso.3.6.1.4.1.3495.1.1.3.0 = Timeticks: (156790) 0:26:07.90
iso.3.6.1.4.1.3495.1.2.1.0 = STRING: "proxy-admin"
iso.3.6.1.4.1.3495.1.2.2.0 = STRING: "squid"
iso.3.6.1.4.1.3495.1.2.3.0 = STRING: "3.3.8"
iso.3.6.1.4.1.3495.1.2.4.0 = STRING: "ALL,1"
iso.3.6.1.4.1.3495.1.2.5.1.0 = INTEGER: 512
iso.3.6.1.4.1.3495.1.2.5.2.0 = INTEGER: 4096
iso.3.6.1.4.1.3495.1.2.5.3.0 = INTEGER: 95
iso.3.6.1.4.1.3495.1.2.5.4.0 = INTEGER: 90
...
4.) Additional resources and useful stuff:
- squid-mib path (Ubuntu 14.04):
/usr/share/squid3/mib.txt
Happy squid monitoring!
- Markus
Add comment