On Wed, 2 Feb 2005 09:26:14 -0500 Alex wrote:
AK> How do I know where snmpd.cof file is?  A user may start Snmpd with a -c
AK> option for snmpd.conf.

Right. You can find out which files snmpd will read by default by running 

        snmpd -Dread_config -H 2>&1 | grep Reading | sort -u

AC> Does a NET-SNMP agent know where to send traps?  Is
AK> it in a MIB?

By trapsinks set in the conf file, or added the to trap mib later. So, in
theory, you could use a snmp query of the agent to find trap destinations. It
is split  over two table, so you'll also have to do a little correlation:

First get each 'tag' and 'type' from the notify table:

$ snmpwalk -v 2c  localhost snmpNotifyTable
SNMP-NOTIFICATION-MIB::snmpNotifyTag.'internal0' = STRING: internal0
SNMP-NOTIFICATION-MIB::snmpNotifyType.'internal0' = INTEGER: trap(1)
SNMP-NOTIFICATION-MIB::snmpNotifyStorageType.'internal0' = INTEGER: readOnly(5)
SNMP-NOTIFICATION-MIB::snmpNotifyRowStatus.'internal0' = INTEGER:
active(1)

Then search for each 'tag' in the target table:

[3:49 rks 08:23 PM ~] aud $ snmpwalk -v 2c  localhost
SNMP-TARGET-MIB::snmpTargetAddrTDomain.'internal0' = OID:
SNMPv2-TM::snmpUDPDomain SNMP-TARGET-MIB::snmpTargetAddrTAddress.'internal0' =
Hex-STRING: 7F 00 00 01 00 A2
SNMP-TARGET-MIB::snmpTargetAddrTimeout.'internal0' = INTEGER: 0
SNMP-TARGET-MIB::snmpTargetAddrRetryCount.'internal0' = INTEGER: 0
SNMP-TARGET-MIB::snmpTargetAddrTagList.'internal0' = STRING: internal0
SNMP-TARGET-MIB::snmpTargetAddrParams.'internal0' = STRING: internal0
SNMP-TARGET-MIB::snmpTargetAddrStorageType.'internal0' = INTEGER: readOnly(5)
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'internal0' = INTEGER: active(1)

The above example is for a simple 'trapsink 127.0.0.1'. You can experiment with
more complex settings for further testing...

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to