Possibly the subagent did not start correctly. I added some "prinf"
statements inside the "main()" function and do not see these being displayed
when the hardware box starts up ..... I need to investgate this more...
Need Help <[EMAIL PROTECTED]> wrote: One of my final steps was to cross-compile
the subagent code into a "libsnmp_subagent.so" file on our build environment.
Instead of running an subagent executable manually to start the subagent on our
hardware box, the subagent now starts when the hardware box boots up by using
the newly created "libsnmp_subagent.so" by calling the "main()" function
automatically.
When the hardware box comes up (and the subagent is running), I can then start
the snmpd master agent manually (just for testing purposes for now) and it does
start up successfully.
For testing on our hardware box, I copied over the SNMP applications (snmpget,
snmpwalk, etc..) into the "/usr/local/bin" director, put the MIB text files
into the "/usr/local/share/snmp/mibs" directory and copied over the "snmp.conf"
file into the "/usr/local/share/snmp" directory.
Here is the "snmpd.conf" file contents:
master agentx
agentxsocket localhost:1610
rocommunity mycommunity_ro
Here is the "snmp.conf" file contents:
mibdirs +/usr/local/share/snmp/mibs
mibs +OC-STB-HOST-MIB:DOCS-IF-MIB:CLAB-DEF-MIB:DOCS-IETF-BPI2-MIB
This code is included in my "subagent.c" file:
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_X_SOCKET, "localhost:1610");
1) I performed the following "netstat -an" command to verify the snmpd master
agent was indeed listening on port "1610":
/usr/local/bin # netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
tcp 0 138 10.0.0.2:23 10.0.0.3:3150 ESTABLISHED
udp 0 0 0.0.0.0:1024 0.0.0.0:*
udp 0 0 0.0.0.0:800 0.0.0.0:*
udp 0 0 0.0.0.0:161 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 5 [ ] DGRAM 39 /var/dev/log
unix 2 [ ACC ] STREAM LISTENING 111
/tmp/xfs_fragtask_mnt_gpfs_ew_media_content_recorded
unix 2 [ ] DGRAM 126
/tmp/inm_unix_sock_worker
unix 2 [ ] DGRAM 128 /tmp/inm_unix_sock_main
unix 2 [ ACC ] STREAM LISTENING 1418 localhost:1610
unix 3 [ ] STREAM CONNECTED 113
/tmp/xfs_fragtask_mnt_gpfs_ew_media_content_recorded
unix 3 [ ] STREAM CONNECTED 117
unix 2 [ ] DGRAM 115
unix 2 [ ] DGRAM 109
unix 2 [ ] DGRAM 43
2) I issued the following command and verified the master agent could process
a master agent specific MIB request:
/usr/local/bin # snmptranslate -On SNMPv2-MIB::sysUpTime.0
.1.3.6.1.2.1.1.3.0
3) I issued the following command and verified the master agent knew about my
MIB text file (OC-STB-HOST-MIB):
/usr/local/bin # snmptranslate -Tp -IR
OC-STB-HOST-MIB::ocStbHostAVInterfaceType.1
+-- -R-- ObjID ocStbHostAVInterfaceType(2)
Textual Convention: AutonomousType
3) Now, I tried executing the following two SNMP requests (snmpwalk, snmpget)
on a MIB which the subagent should be processing and the "snmpwalk" returned
absolutely nothing and the "snmpget" returned an error:
/usr/local/bin # snmpwalk -v1 -c mycommunity_ro 127.0.0.1
ocStbHostAVInterfaceTable
(nothing returned here at all)
/usr/local/bin # snmpget -v 1 -c mycommunity_ro 127.0.0.1
ocStbHostAVInterfaceType.1
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: OC-STB-HOST-MIB::ocStbHostAVInterfaceType.1
Questions:
a) What could be causing the "snmpget" error?
b) How can I verify whether the subagent is getting a SNMP request at all?
c) How do you recommend debugging this?
Note: Before compiling the subagent code into a "library.so" file, I started
the subagent executable file manually on our hardware box and everything
(including all commands listed above) worked great. As a result, I would
assume the snmpd master agent which I am currently running now (since it is
the same one as before) is working fine. The problem must lie with the
subagent. Why would the subagent suddenly not work when I take the same exact
code and compile it into a "library.so" file rather than starting the subagent
up using an executable?
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on,
when.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.
---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. -------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders