Re: About Dynamically Load my MIB

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
    [ First - *please* don't mail me privately, without copying
     any responses to the mailing list.  I don't have the time
     or inclination to offer private, unpaid, SNMP consultancy.
     Keep discussions to the list, where others can both learn
     and offer advice.  Thanks.   ]


2009/11/16 飞飞 <[email protected]>:
> root@ubuntu:/usr/share/snmp/mibs# snmpd -f -L -Duit,dlmod
> registered debug token uit, 1
> registered debug token dlmod, 1
> dlmod: register mib
> dlmod: dlmod_path: /usr/lib/snmp/dlmod
>           /* I really have no idea what its meaning */

This is the default directory where the agent will look for
.so modules to load.   But you specify a full path below,
so don't need to worry about this.


> dlmod: dlmod_create_module
> dlmod: dlmod_load_module uit: /usr/share/snmp/mibs/uit.so

No is error displayed here, so it looks as if the module is
being loaded successfully.


> /etc/snmp/snmpd.conf: line 430: Warning: Unknown token: mibs.

The "mibs" directive is typically aimed at client applications,
and belongs in the file "snmp.conf", not the agent-specific file.


> Error opening specified endpoint ""
> Server Exiting with code 1

Typically that would indicate that you're running the
agent as a non-root user, and trying to open the standard
(privileged) port.   Which fails.

But given that you seem to be running this as root,
my suspicion is that you're already running an SNMP
agent, listening on this port.

Either stop this standard agent before running your
new one, or run your testing on a different port
e,g:
    snmpd -f -Le -Duit,dlmod   6161


> /* /etc/snmp/snmpd.conf: line 430 is: mibs +ALL is anything wrong? */

This directive belongs in snmp.conf


Dave


> I modified a Makefile file for my own use,as follows:
>
> CC=gcc
> OBJS1=snmpdemoapp.o
> OBJS2=example-demon.o uit.o
> OBJS3=asyncapp.o
> TARGETS=example-demon snmpdemoapp asyncapp
> CFLAGS=-I. `net-snmp-config --cflags`
> BUILDLIBS=`net-snmp-config --libs`
> BUILDAGENTLIBS=`net-snmp-config --agent-libs`
> # shared library flags (assumes gcc)
> DLFLAGS=-fPIC -shared
> all: $(TARGETS)
> snmpdemoapp: $(OBJS1
>         $(CC) -o snmpdemoapp $(OBJS1) $(BUILDLIBS)
> asyncapp: $(OBJS3)
>         $(CC) -o asyncapp $(OBJS3) $(BUILDLIBS)
> example-demon: $(OBJS2)
>         $(CC) -o example-demon $(OBJS2)  $(BUILDAGENTLIBS)
> clean:
>         rm $(OBJS2) $(OBJS2) $(TARGETS)
> uit.so: uit.c Makefile
>         $(CC) $(CFLAGS) $(DLFLAGS) -c -o uit.o uit.c
>         $(CC) $(CFLAGS) $(DLFLAGS) -o uit.so uit.o
> Is anything wrong here?
>
> Alex

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.