# Squid snmp problems



## akripo (Dec 3, 2010)

Hi to all,

I have problem with squid when trying to tune the integrated snmp service.
My intention was to restrict squid snmp service to listen to specific ip address (127.0.0.1).

When I am starting up the daemon using the snmp configuration options "snmp_incoming_address" and "snmp_outgoing_address" it dies with a error message "Address already in use" on every valid IP I have set ( on the example, I was trying localhost and port 33161).

If I remove these two options then the snmp service binds to 0.0.0.0:33161 and works without problem!

Any ideas?


Thanks



```
1011:root@poseidon:~# grep ^snmp /usr/local/etc/squid/squid.conf
snmp_port 33161
snmp_access allow queryme localhost
snmp_access allow queryme adminpc
snmp_access deny all
1012:root@poseidon:~# sockstat | egrep 'squid|33161'
1013:root@poseidon:~# 
1013:root@poseidon:~# /usr/local/etc/rc.d/squid restart ; tail /var/log/squid/cache.log
Starting squid.
2010/12/04 00:43:40| Accepting  HTTP connections at 10.99.1.4:3128, FD 15.
2010/12/04 00:43:40| Accepting  HTTP connections at 127.0.0.1:3128, FD 16.
2010/12/04 00:43:40| HTCP Disabled.
2010/12/04 00:43:40| Accepting SNMP messages on 127.0.0.1:33161, FD 17.
2010/12/04 00:43:40| commBind: Cannot bind socket FD 18 to 127.0.0.1:33161: (48) Address already in use
FATAL: Cannot open Outgoing SNMP Port
Squid Cache (Version 3.1.8): Terminated abnormally.
CPU Usage: 0.052 seconds = 0.030 user + 0.022 sys
Maximum Resident Size: 11392 KB
Page faults with physical i/o: 0
1014:root@poseidon:~# sockstat | egrep 'squid|33161'
1015:root@poseidon:~# 
1015:root@poseidon:~# squid -v
Squid Cache: Version 3.1.8
configure options:  '--with-default-user=squid' '--bindir=/usr/local/sbin' '--sbindir=/usr/local/sbin' '--datadir=/usr/local/etc/squid' '--
libexecdir=/usr/local/libexec/squid' '--localstatedir=/var/squid' '--sysconfdir=/usr/local/etc/squid' '--with-logdir=/var/log/squid' '--with-
pidfile=/var/run/squid/squid.pid' '--enable-removal-policies=lru heap' '--disable-linux-netfilter' '--disable-linux-tproxy' '--disable-epoll' 
'--disable-translation' '--enable-auth=basic digest negotiate ntlm' '--enable-basic-auth-helpers=DB NCSA PAM MSNT SMB squid_radius_auth LDAP 
YP' '--enable-digest-auth-helpers=password ldap' '--enable-external-acl-helpers=ip_user session unix_group wbinfo_group ldap_group' '--enable-
ntlm-auth-helpers=smb_lm' '--enable-negotiate-auth-helpers=squid_kerb_auth' '--enable-storeio=ufs diskd aufs' '--enable-disk-io=AIO Blocking 
DiskDaemon DiskThreads' '--enable-ipfw-transparent' '--enable-pf-transparent' '--disable-ecap' '--disable-loadable-modules' '--enable-kqueue' 
'--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.1' 'build_alias=amd64-portbld-
freebsd8.1' 'CC=cc' 'CFLAGS=-O2 -pipe -I/usr/local/include  -DLDAP_DEPRECATED -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib' 'CPPFLAGS=' 
'CXX=c++' 'CXXFLAGS=-O2 -pipe -I/usr/local/include -DLDAP_DEPRECATED -fno-strict-aliasing' --with-squid=/usr/ports/www/squid31/work/squid-3.1.8
1016:root@poseidon:~# uname -ripv
8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64 GENERIC
```


----------



## akripo (Dec 3, 2010)

Obviously I forgot to RTFM...

http://www.squid-cache.org/Doc/config/snmp_incoming_address/





P.S.
How can I append the prefix [Solved] ?


----------



## DutchDaemon (Dec 4, 2010)

Edit first post -> Go Advanced -> Pull-down menu next to title.


----------

