I am using NetSNMP-v5.4 on a Linux environment.
I have traced a lot of the subagent code to try to figure out why my subagent
fails to connect to the master agent when it has been built as a shared object
(ie: ".so" file) but is allowed to connect to the master agent when the
subagent has been built as an executable instead.
The master agent can be started with no problem. When the subagent (built as a
shared object ".so" library file) tries to connect to the master agent, then
this is the processing order I see:
1) agentx_reopen_session()
2) subagent_open_master_session()
3) netsnmp_transport_open_client()
4) netsnmp_tdomain_transport_full()
The input parameters to this function are as follows:
application = agentx
str = 127.0.0.1:16100
local = 0
default_domain = [NIL]
default_target = [NIL]
Note: There was no domain given so it is eventually defaults to "unix"
5) netsnmp_lookup_default_target()
domain=unix address=127.0.0.1:16100 default address=/var/agentx/master
6) netsnmp_unix_create_tstring()
7) netsnmp_unix_transport()
8) connect()
The "connect()" function could not connect to "127.0.0.1:16100" and
returns and "error number 146 (Connection refused)"
This eventually leads to the following error being produced.
"Warning: Failed to connect to the agentx master agent (127.0.0.1:16100)"
Any idea why the subagent can not connect to "127.0.0.1:16100" when built as a
shared object (ie: "so" file)?
Is there some rule/permissions which might exist which prevent shared objects
from connecting to certain ports? I was told by our build people here that
everything running on our hardware box should have "root" access. They do not
understand why the subagent can not connect to the port as a shared object but
can as an executable.
Perhaps there is some way to confirm whether the subagent has the appropriate
access rights (if required) somehow?
Note: If the subagent is built into an executable (instead of a "so" file), then
the connection to "127.0.0.1:16100" is allowed when the "connect()" function is
called and everything works fine.
---------------------------------
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get online.
---------------------------------
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get online.-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders