Have you lately tried to use SNMP with WebLogic? I did, because I upgraded an earlier Windows-based domain to WebLogic 12.1.2 running on CentOS Linux.
WebLogic is showing some strange and undesired behaviour here… Firstly, to get started with SNMP basically all you need to do is to enable the SNMP agent.
This is good enough when running under Windows. Then you might specify a trap destination such as localhost 4000 and run the WebLogic command-line tool to listen to the destination and verify if your setup is working.
The command line to run the trap listener looks like this
$ java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 4000 Listening on port:4000
Now, of course you (well, in this case me) forgot to modify SNMP UDP Listen Port and the Master AgentX Port. For sure you know that you cannot bind to ports less than 1024 in UNIX.
- Interesting enough, there is an error message in the Weblogic startup – it is just pointing you to the wrong direction since it complains about port 171 not being available. Now, you might wonder, port 171 is configured nowhere!
- Apparently WebLogic is trying 161 and the following 10 port numbers, eg. to avoid conflicts when several servers are running on a single machine (nothing to complain about, this behavior is documented, just click on “help”).
- If all ports are unavailable (or not allowed for non-root users in UNIX), WebLogic does not complain about the configured port not available, but about the last one it tried. Not such a good solution…
- Looking at the Master AgentX port, the situation is different again. Of course the restriction for binding to ports less than 1024 still applies, but there is no auto-increment on WebLogic. Unfortunately, the error message in the log file does not even mention the port number.
To conclude, when specifying a SNMP port number that you cannot bind to, you might see an error message containing a different port number than the one you configured for SNMP UDP Listen Port.
For the Master AgentX Port you will see a rather generic message, not containing the problematic port number at all.
Both is good to know and leaves some space for improvement.
<Sep 21, 2013 8:53:54 AM CEST> <Error> <SNMP> <BEA-320951> <Failed to initalize the SNMP AgentX master subagent. One possible cause is the failure to bind the Master agentX port. If this is the case, check to see if the specified AgentX port is available, or ensure that the process has permissions to bind to the desired port. weblogic.diagnostics.snmp.agent.SNMPAgentToolkitException: java.net.BindException: Permission denied at weblogic.diagnostics.snmp.agent.monfox.MonfoxToolkit.initializeMasterAgentX(MonfoxToolkit.java:186)