Hi, I'm David, from Spain.
I want to write a dinamically loadable object, and to begin, I'm
following the tutorial "Writing a Dynamically Loadable Object" in the
Net-SNMP web. I'm working on Fedora 10 and I have the net-SNMP 5.4.2.1
version
I have downloaded all files (NET-SNMP-TUTORIAL-MIB,
nstAgentPluginObject.h, nstAgentPluginObject.c, and the makefile) I
have create the nstAgentPluginObject.so and then I did the following
steps:
1. Start the snmpd and watch the dlmod and nstAgentPluginObject
modules interact using the debugging flag (this assumes you already
have access control set up properly for your agent):
% snmpd -f -L -DnstAgentPluginObject,dlmod -C -c /dhervas/
configuracion/snmpd.conf
My snmpd.conf, that is located in /dhervas/configuracion/snmpd.conf, is
this:
# Access Control
###############################################################################com2sec
local localhost COMMUNITY1
com2sec mynetwork 192.168.100.0/24 COMMUNITY2
com2sec mired 192.168.100.3/32 COMMUNITY3
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork
group MyRWGroup2 v1 mired
group MyRWGroup2 v2c mired
group MyRWGroup2 usm mired
# incl/excl subtree mask
view all included .1 80
# context sec.model sec.level match read write
notif
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none
access MyRWGroup2 "" any noauth exact all all
none
###############################################################################
# CONFIGURANDO SNMPV3
rwuser usuario
createUser usuario MD5 administrator DES
########################################################333
mibs ALL
###############################################################################
# System contact information
#
syslocation Alcobendas, Madrid, Spain
syscontact David Hervas
<dher...<http://groups.google.com/groups/unlock?hl=en&_done=/group/mailing.unix.net-snmp-coders/browse_thread/thread/9b94c3d011093dd7%3Fhl%3Den&msg=a9f610cf35cf9389>
@tmira.com>
#############################################################################
# dynamically load modules as shared objects
#dlmod nstAgentPluginObject /dhervas/librerias/nstAgentPluginObject.so
2. In another window, test to make sure that the agent doesn't
currently support the nstAgentPluginObject (if you get different
results running this command you need to recompile the net-snmp agent
without the nstAgentPluginObject mib module compiled in directly):
% snmpget -v 2c -c COMMUNITY1 localhost NET-SNMP-TUTORIAL-
MIB::nstAgentPluginObject.0
3. Then, run snmpset to create a new row in the dlmod table:
% snmpset -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodStatus.1 i create
dlmodStatus.1 = create(6)
4. See that the row was created:
% snmptable -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodTable
SNMP table: dlmodTable
dlmodName dlmodPath dlmodError dlmodStatus
unloaded
5. Then set the properties of the row up to point to our new object
and to give it a name:
% snmpset -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodName.1 s "nstAgentPluginObject" UCD-DLMOD-MIB::dlmodPath.1 s
"/dhervas/librerias/nstAgentPluginObject.so"
dlmodName.1 = "nstAgentPluginObject"
dlmodName.1 = "/dhervas/librerias/nstAgentPluginObject.so"
% snmptable -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodTable
SNMP table: dlmodTable
dlmodName dlmodPath dlmodError dlmodStatus
nstAgentPluginObject /dhervas/librerias/
nstAgentPluginObject.so unloaded
6. Finally, load the shared object into the running agent:
% snmpset -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodStatus.1 i load
dlmodStatus.1 = loaded(1)
% snmptable -v 2c -c COMMUNITY1 localhost UCD-DLMOD-
MIB::dlmodTable
7. If everything above was done correctly, then the following
command should work and will access the shared object's data:
% snmpget -v 1 -c COMMUNITY localhost NET-SNMP-TUTORIAL-
MIB::nstAgentPluginObject.0
nstAgentPluginObject.0 = INTEGER: 3
The cuestion is that I have 1 problem:
in the steps 1, 2, 3, 4 and 5 I don't have any problem, I can create a
row and set the properties.
But in the step 6, the response that I have is:
Timeout: No Response from localhost
The problem is that when I try to load the shared object into the
agent, the agent falls down.
If I try the other way, to modify the snmpd.conf to include the dlmod
line(delete the # symbol in the snmpd.conf):
dlmod nstAgentPluginObject /dhervas/librerias/nstAgentPluginObject.so
and then try to start the daemon, it doesn't work, the agent can't
start!
I don't know why if I introduce this line, the daemon doesn't start,
and why if I try to load the shared object into the agent following
the 7 steps of the tutorial, the daemon stops in the sixth step.
When I'm doing the seven steps, in the first
window, where I do the first step, i have this result:
snmpd -f -L -DnstAgentPluginObject,dlmod -C -c /dhervas/configuracion/
snmpd.conf
registered debug token nstAgentPluginObject, 1
registered debug token dlmod, 1
dlmod: register mib
dlmod: dlmod_path: /usr/local/lib/snmp/dlmod
NET-SNMP version 5.4.2.1
dlmod: dlmod_create_module
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmodEntry dlm: 0x9164d00 dlmod_index: 1
dlmod: dlmod_load_module nstAgentPluginObject: /dhervas/librerias/
nstAgentPluginObject.so
Excepción de coma flotante(floating point exception in English)
If someone could help me I would be very grateful. I'm new in Snmp,
all that u can say to me it could help me.
Thanks in advance.
David from Spain.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders