Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I need to use SNMP monitoring for java applications, there is the need to that application (usually ran as daemon user) to listen on snmp port.

If there is no other alternative, of course I can use another port, say 11161.

But I can use XInetd to redirect port 161 to 11161.

My question is: is this the best method? Is iptables port redirection better?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

First of all - the Oracle-description sucks. The proper way to use SNMP for an application (java is a application with regards to the operating system) is to register it as sub-agent to the OS-snmp-service (in case of linux: snmpd).

There has to be a way to accomplish that. Afterwards you can use the SNMPD-security settings (see the man-pages of snmpd) to restrict access to that part of the MIB.

share|improve this answer
add comment

In general, xinetd is a good solution. For one-offs, I often use balance just because everything can be set up on the command line, but if you need to do it more than once, xinetd is a better choice.

Redirection via iptables works just fine, but it suffers from a lack of transparency. If someone else has to maintain the system, they might be unaware of the redirect rules, whereas proxy solutions like xinetd show up in the output of various standard diagnostic commands like netstat and so forth.

share|improve this answer
1  
xinetd also has the benefit of generating some syslog entries (for awful apps that don't syslog), shows up in chkconfig (sometimes) and has libwrap support. –  JodieC Mar 27 '12 at 12:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.