[Logo] Mango M2M Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
SNMP Bind Exception and IPV6  XML
Forum Index -> Mango installation
Author Message
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

This is an FYI

I transferred a mango installation to a new host (and from windows to linux) and found that none of the SNMP Data sources would work.

Code:
'SNMP Datasource Name': java.net.BindException: Permission denied

editing /etc/modprobe.d/aliases so that
Code:
alias net-pf-10 ipv6

becomes
Code:
alias net-pf-10 off

disabled IPV6 and fixed the problem
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Did you try setting the preferred Java stack? I believe this is the option:

Code:
-Djava.net.preferIPv4Stack=false

Best regards,
Matthew Lohbihler
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

Ah nope, didn't know the option existed.
narenblr

Padawan

Joined: 06/10/2009 01:17:36
Messages: 28
Location: Bangalore, India
Offline

Also remember < 1024 ports on UNIX/Linux are privilidged ports and can be run only as root or by Xinetd. Hence, you should run mango as root and not as an ordinary user.
[Yahoo!]
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

narenblr wrote:
Also remember < 1024 ports on UNIX/Linux are privilidged ports and can be run only as root or by Xinetd. Hence, you should run mango as root and not as an ordinary user. 


Yep upon further investigation I still seem to be getting the error. I think before it gave that error because it couldn't bind to the port and SNMP poll didn't work because of the IPV6 issue.

Now mango can poll the SNMP data sources since I've disabled IPV6 but is still giving the BindException because it can't listen. I'm not using SNMP traps, just poll, so mango shouldn't need to bind to any low port numbers.

I won't be running any webapp as root
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

I'm not using SNMP traps, just poll, so mango shouldn't need to bind to any low port numbers.  


SNMP is UDP, so you'll always be listener binding even if you're not using traps.

Best regards,
Matthew Lohbihler
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

gotcha. but shouldn't need to bind to port 162 if not using traps right?
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Not to 162, no. But 161 is the default port for other SNMP traffic, and since the data source is UDP it needs to bind to a port as a listener to get responses. If you didn't change from the default of 161 and you're not running as root, this would explain why you get a permission exception on Linux when you didn't get one under Windows.

Best regards,
Matthew Lohbihler
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

netstat -anutp reveals one listening UDP port per SNMP data source, but not port 161

If I disable an SNMP data source and re-enable it, I get the BindException. If I reboot the server I get the BindException but the data source still seems to update.

None of this is critical for me, I'll let you know how it pans out.

Code:
udp        0      0 0.0.0.0:36751           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:33301           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:39594           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:60990           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:34119           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:39881           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:34009           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:48879           0.0.0.0:*                           10106/java      
 udp        0      0 0.0.0.0:42866           0.0.0.0:*                           10106/java   
craig

Knight

Joined: 06/08/2007 16:50:46
Messages: 113
Offline

Since I'm not using traps I changed the trap port in SNMP datasource settings to a large port number and no longer get the BindException.

If I were using traps I think I'd do some port translation on the firewall so that incoming UDP port 162 packets were sent to a higher port on the mango instance
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Ah, right. The data source will listen for traps in any case. You can always just change the port number from 162 to, say 50162.

Best regards,
Matthew Lohbihler
 
Forum Index -> Mango installation
Go to:   
Powered by JForum 2.1.7 © JForum Team