[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference molar::snmp

Title:SNMP
Moderator:MKNME::DANIELE
Created:Mon Apr 02 1990
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:289
Total number of notes:900

285.0. "problem with trap" by MLNCSC::VOCI () Tue Mar 18 1997 12:28

Hello,

I have a customer that claims that esnmp on Digital Unix doesn't work well.
He has built a small example starting from the chess example in 
/usr/examples/esnmp.

The customer says that the chess agent in not reacting to traps, he has sent 
traps via a C program and via Netview, but nothing happens.

Unfortunately I don't know esnmp programming, and the only documentation I see
in the "network programmer's guide" is quite confusing for a non expert.

It would me usefull a detailed README on the chess example.

You can find the example agent.tar via anonymous ftp on osftec.mln.dec.com
Unix 4.0b
Any idea is wellcome.

Thanks,
Gea
T.RTitleUserPersonal
Name
DateLines
285.1SMURF::DANIELETue Mar 18 1997 20:3321
I may not understand your question... but SNMP agents aren't
supposed to do anything with RECEIVED traps (other than silently
discard them, and for SNMPv1, increment a counter in the snmp MIB).

SNMP agents sometimes SEND traps.  Typically you configure an agent
to know where to send traps.  Then some software (like NetView) running on 
those systems, does something with the traps.

eSNMP provides a way for subagents to indicate to the master agent
that a trap should be sent.  The master agent (snmpd) sends them according
to its configuration file.  See the doc for esnmp_trap() and the snmpd
man page.

So, if you are sending a trap to a Digital UNIX system, the (extensible)
agent running there isn't even going to see them.  You can run 
/usr/sbin/snmp_traprcv, which is just a program that listens on UDP 162 and
dumps out what it receives, to see if traps are arriving at the system...

Hope this helps.  If I'm not understanding your question please let me know.

Mike
285.2more infosMLNCSC::VOCIWed Mar 19 1997 13:4517
Hello Mike,

I've talked to the customer and he is developping a SNMP agent that sends a trap
when a particular event happens. They are using the esnmp_trap().
He has put under trace /usr/sbin/snmpd, but the trap is never received by the
daemon.
He has also tried using netview on the same machine but it doesn't receive any
trap.
So, if my uderstanding is correct, the snmp agent never receives traps, but it 
sends them to the snmpd (or it tells with esnmp_trap () to send a trap); but
where do I associate the program that must react to the trap (for example 
printing an allarm message on the console?

Forgive my ignorance.

Thanks,
Gea
285.3docs?MLNCSC::VOCIWed Mar 19 1997 14:5521
    Hello,
    I'm trying to use the chess example and I wanted to get from the agent
    the number of registered games.
    I went through the man page and the rfcs and decided that the
    snmp_request was the right command.
    I ran chess_mib -trace on one window and issued the command
    
    /usr/sbin/snmp_request opale chess get 1.3.6.1.4.1.36.2.15.2.99.3
    /usr/sbin/snmp_request:  no response - try again.
    
    I tried the following agent name with no success: chess_mib,
    chess_subtree 
    
    In output of the trace I see 
    
    RESPONSE to REGISTRATION of 'chess': OK
    
    Is there any white paper for snmp beginners ?
    
    Thanks,
    Gea
285.4SMURF::DANIELEWed Mar 19 1997 19:2223
>I've talked to the customer and he is developping a SNMP agent that sends a trap
>when a particular event happens. They are using the esnmp_trap().
>He has put under trace /usr/sbin/snmpd, but the trap is never received by the
>daemon. 
>He has also tried using netview on the same machine but it doesn't receive any
>trap.

when a subagent calls esnmp_trap(), libesnmp.so communicates w/
snmpd.  you probably won't see this in any trace (since it doesn't
use TCP/IP).

you're probably not seeing the trap go anywhere because snmpd
isn't configured to send them.  the default snmpd.conf does not
contain any entries that cause traps to be sent, you need to add them.
see the snmpd man page.

if you edit snmpd.conf and have traps sent to a Digital UNIX system,
you can display them on that system by running /usr/sbin/snmp_traprcv.

I don't know how to configure NetView to display/do something with
traps.

Mike
285.5SMURF::DANIELEWed Mar 19 1997 19:2722
re .3:
   
>    /usr/sbin/snmp_request opale chess get 1.3.6.1.4.1.36.2.15.2.99.3
>    /usr/sbin/snmp_request:  no response - try again.
    
>    I tried the following agent name with no success: chess_mib,
>    chess_subtree 
 
the second command line argument is a community name, not the name
of the subagent or of a MIB.  community names are how SNMP access control
is done.

again, see snmpd.conf for how to configure community names.
by default, snmpd.conf permits read access to the world using the
community name "public".  so try that and you'll probably see something :-)
   
>    Is there any white paper for snmp beginners ?
    
Not really.  eSNMP for Digital UNIX is intended for folks who are
knowledgable in SNMP and want to develop subagents.

Mike