all connections are refused except SNMP queries
Hi, I put the snmp agent running as a thread in a SIP proxy. Now, after integrating them together, except SNMP commands work, no connection can be established from user to SIP proxy by TCP connection. Any TCP connection is simply refused. At the same time, telnet to 127.0.0.1 is refused also. Sending UDP message to the proxy has no response also. But, all SNMP commands works. I can query SNMP agent remotely. If I disable SNMP agent, everything works fine. I configure the net-snmp-5.7.2.1 with "--without-libwrap --without-openssl --enable-mini-agent, --enable-static --disable-shared ". This is running as C++ code, I also disabled all perl or python configurations. In my testing machine, /etc/hosts.allow and hosts.deny have nothing defined. This is on Linux RHEL 6. My snmpd.conf only has one line "rwcommunity public". Please advise what might cause the problem. I will give a demo tomorrow, so any quick response is deeply appreciated. Thank you a lot, Linda-- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: all connections are refused except SNMP queries
I cannot understand from your description what is going on, but did you check basic things like * that no firewall interferes * whether snmpd listens for tcp at all with "netstat -lp" * snmpd logs * starting "snmpd -f" to eventually see more error messages Best regards, Michael smime.p7s Description: S/MIME Cryptographic Signature -- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: all connections are refused except SNMP queries
Michael: Thank you so much for you looking into my problem. I am running snmpd as a thread in my SIP proxy (named BSP). When snmpd is not enabled, everything is working fine. However, once snmpd is enabled, only connection to SNMPd is working, all other connections do not work. As you suggested, I issued command "netstat -lp", here is what happened. If snmpd is not enabled, BSP listens to all the ports it should: [root@proxy-mobile-2]# netstat -lp --numeric-ports Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:8052 *:* LISTEN 19945/bsp tcp 0 0 proxy-mobile-ob-vm-02.:5081 *:* LISTEN 19945/bsp tcp 0 0 localhost:30052 *:* LISTEN 19945/bsp udp 0 0 proxy-mobile-ob-vm-02.d:8052 *:* 19945/bsp udp 0 0 proxy-mobile-ob-vm-02.d:5081 *:* 19945/bsp However, once I enabled snmpd, BSP no longer listen to these port, except 9000, which is SNMP port I specified: [root@proxy-mobile-2]# netstat -lp --numeric-ports Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:8052 *:* LISTEN - tcp 0 0 localhost:30052 *:* LISTEN - udp 0 0 proxy-mobile-ob-vm-02.d:8052 *:* - udp 0 0 *:9000 *:* 20076/bsp udp 0 0 proxy-mobile-ob-vm-02.d:5081 *:* - Any idea what might cause it? Thank you a lot, Linda On Wednesday, April 30, 2014 8:10 AM, Michael Bunk wrote: I cannot understand from your description what is going on, but did you check basic things like * that no firewall interferes * whether snmpd listens for tcp at all with "netstat -lp" * snmpd logs * starting "snmpd -f" to eventually see more error messages Best regards, Michael -- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders-- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: all connections are refused except SNMP queries
Michael: I make everything work together by starting up snmp agent thread first, before other threads start, so that the sockets opened by other threads will not be shutdown by snmp agent. This is a work around solution. I still don't know why snmp agent shutdown all the other open sockets. If you find the reason, please let me know. Thank you a lot for your help. Thank you, Linda On Wednesday, April 30, 2014 10:26 AM, linda zhu wrote: Michael: Thank you so much for you looking into my problem. I am running snmpd as a thread in my SIP proxy (named BSP). When snmpd is not enabled, everything is working fine. However, once snmpd is enabled, only connection to SNMPd is working, all other connections do not work. As you suggested, I issued command "netstat -lp", here is what happened. If snmpd is not enabled, BSP listens to all the ports it should: [root@proxy-mobile-2]# netstat -lp --numeric-ports Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:8052 *:* LISTEN 19945/bsp tcp 0 0 proxy-mobile-ob-vm-02.:5081 *:* LISTEN 19945/bsp tcp 0 0 localhost:30052 *:* LISTEN 19945/bsp udp 0 0 proxy-mobile-ob-vm-02.d:8052 *:* 19945/bsp udp 0 0 proxy-mobile-ob-vm-02.d:5081 *:* 19945/bsp However, once I enabled snmpd, BSP no longer listen to these port, except 9000, which is SNMP port I specified: [root@proxy-mobile-2]# netstat -lp --numeric-ports Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:8052 *:* LISTEN - tcp 0 0 localhost:30052 *:* LISTEN - udp 0 0 proxy-mobile-ob-vm-02.d:8052 *:* - udp 0 0 *:9000 *:* 20076/bsp udp 0 0 proxy-mobile-ob-vm-02.d:5081 *:* - Any idea what might cause it? Thank you a lot, Linda On Wednesday, April 30, 2014 8:10 AM, Michael Bunk wrote: I cannot understand from your description what is going on, but did you check basic things like * that no firewall interferes * whether snmpd listens for tcp at all with "netstat -lp" * snmpd logs * starting "snmpd -f" to eventually see more error messages Best regards, Michael -- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders-- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: all connections are refused except SNMP queries
Den 30-04-2014 17:57, linda zhu skrev: > This is a work around solution. I still don't know why snmp agent > shutdown all the other open sockets. If you find the reason, please let > me know. How much of snmpd.c did you clone into your thread code? The main part will start by closing all open file descriptors except std-in/out/err. /Niels -- Niels Baggesen -- @home -- Århus -- Denmark -- ni...@baggesen.net The purpose of computing is insight, not numbers -- R W Hamming -- Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
Re: all connections are refused except SNMP queries
Den 06-05-2014 16:02, linda zhu skrev: > Only one thread, and make "dont_fork" to 1. Please reply to the list to keep everyone in the loop - there are more wizards than me out there :-) If yo9ur response here means that you have taken the complete main program and made that into a thread, then you should look at the first 20 or so lines of the main function and notice that it will close any file descriptor available, which will include any socket that you may have already opened. /Niels -- Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net The purpose of computing is insight, not numbers --- R W Hamming -- Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce ___ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders