Hello Bill,
Thank for the reply.
I rebuilt the library without the --with-out-transports="Unix" option in the
configuration, still the same issue. Interesting enough, I have attempted to
enable debugging in my subagent by passing "agetnx" to debug_register_tokens
and the debug tokens fail to set in my production environment.
snmp_debug_init();
snmp_enable_stderrlog();
snmp_set_do_debugging(1);
debug_register_tokens("agentx");
The result of debug_token_is_registered("agentx") returns SNMPERR_GENERR and
snmp_get_do_debugging() is also showing that debugging isn't enabled. I know
that the master agent on my production environment supports debugging as I've
used it quite a lot.
Thank You,
Dakota
From: Bill Fenner <[email protected]>
Sent: Saturday, March 19, 2022 10:01 AM
To: Dakota Diehl <[email protected]>
Cc: [email protected]
Subject: Re: Cross Compiled AgentX subagent does not connect to master agent
On Thu, Mar 17, 2022 at 7:19 PM Dakota Diehl via Net-snmp-users
<mailto:[email protected]> wrote:
Hello,
I am working to implement a custom MIB for my company. I have developed the
subagent following the tutorial on
https://urldefense.com/v3/__http://net-snmp.org__;!!I9LPvj3b!FJ1kkrbSO_edB4UrRm_BFEwENb7H1MDFbMUPEbE5kE42c_eEEpGRV4xuB04XqwIhQKPKLYZRiqXLpP335g$
and used mib2c to generate the code for my MIB. I have built the code on my
X86_64 development box and it works great. I have downloaded "net-snmp-5.9.1"
and cross compiled it for my production enviroment. Here are the output from
lscpu on my production enviroment.
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
Vendor ID: ARM
Model: 0
Model name: Cortex-A9
Stepping: r3p0
BogoMIPS: 200.00
Flags: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
I've used the "arm-linux-gnueabifh-gcc" cross complier to cross-comple my
subagent. When I execute my code on the production enviroment, it seems to
run fine, but doesn't connect to the master agent. The version of snmpd on
the production enviroment is:
NET-SNMP version: 5.8
Web:
https://urldefense.com/v3/__http://www.net-snmp.org/__;!!I9LPvj3b!FJ1kkrbSO_edB4UrRm_BFEwENb7H1MDFbMUPEbE5kE42c_eEEpGRV4xuB04XqwIhQKPKLYZRiqVBwq028A$
Email: mailto:[email protected]
When I look at the snmpd.log file, there is no mention of any AgentX events.
To make things more confusing, I prototyped my subagent using the python
"pyagentx" library and it connects to the master on the production environment
just fine. I had to move away from the python implementation due to lack of
support for notifications.
I am using the same snmpd.conf file between my development and production
environment. And this is the config options I used to configure the net-snmp
environment for cross compilation:
./configure \
--with-cc=$CROSS \
--prefix=$PREFIX \
--host=$HOST \
--build=$BUILD \
--exec-prefix=$PREFIX/usr \
--sysconfdir=/etc \
--enable-static \
--enable-shared \
--with-persistent-directory=/var/lib/snmp \
--disable-static \
--with-defaults \
--enable-mini-agent \
--without-rpm \
--with-logfile=none \
--without-kmem-usage \
--enable-as-needed \
--without-perl-modules \
--disable-embedded-perl \
--disable-perl-cc-checks \
--disable-scripts \
--with-default-snmp-version="1" \
--enable-silent-libtool \
--enable-mfd-rewrites \
--with-sys-contact="Westermo Data Communications Inc." \
--with-sys-location="Westermo" \
--with-mib-modules="host ucd-snmp/dlmod my_mib/overview
my_mib/CurlSystemCallFunc" \
--with-out-transports="Unix" \
--with-endianness=little \
--without-openssl \
--disable-manuals \
--disable-debugging \
--with-cflags="-I$PREFIX/usr/include -I$PREFIX/usr/include/glib-2.0
-I$PREFIX/usr/lib/glib-2.0/include" \
--with-ldflags="-L$PREFIX/lib" \
--with-mibdirs="$HOME/.snmp/mibs:/usr/share/snmp/mibs"
The environment variables are as follows:
CROSS=arm-linux-gnueabihf-gcc
PREFIX=/home/dev/Development/net-snmp-5.9.1/rootfs
HOST=arm-linux-gnueabihf
BUILD=i386-linux
Any ideas on what I'm missing here?
The default agentx transport is a UNIX domain socket, and your configure line
includes --with-out-transports="Unix". How are you specifying the agentx
connection mechanism for both the master and subagent?
Bill
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users