Hi

Is it possible to register to the sysORTable from within a subagent? It
works when I register to the sysORTable when compiling the
nstAgentModuleObject.c into the Agent. If I register to sysORTable from the
example subagent (nstAgentSubagentObject.c and example-demon.c) nothing ends
up in the sysORTable. This is compiled on an Ubuntu system.

This is the code i've added to nstAgentModuleObject.c and
nstAgentSubagentObject.c:

extern int      register_sysORTable(oid *, size_t, const char *);
extern int      unregister_sysORTable(oid *, size_t);

static oid      sysORTable_reg[] = { 1, 3, 6, 1, 2, 1, 10, 999 };
static size_t   sysORTable_reglen = 8;

register_sysORTable(sysORTable_reg, sysORTable_reglen,
                               "Test registration from agent/subagent");


Doesn't the sysORtable registration work from within a subagent or is it
broke?

Or is there some compiler or linker options missed when following the
tutorial(Instrumenting your own code with agentx subagent support) to
compile a subagent and adding sysORTable support?

gcc -I. -g -O2 -Ulinux -Dlinux=linux -D REENTRANT -D GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/perl/5.8/CORE -I.
-I/usr/local/include -c -o example-demon.o example-demon.c
gcc -I. -g -O2 -Ulinux -Dlinux=linux -D REENTRANT -D GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/perl/5.8/CORE -I.
-I/usr/local/include -c -o nstAgentSubagentObject.o nstAgentSubagentObject.c
gcc -o example-demon example-demon.o nstAgentSubagentObject.o
-L/usr/local/lib -lnetsnmpagent -lnetsnmphelpers -lnetsnmpmibs -lnetsnmp
-Wl,-E -L/usr/local/lib /usr/lib/perl/5.8/auto/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -ldl -lm -lpthread -lc -lcrypt


Regards,
Goran
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to