Re: add trap dest via snmpNotifyTable & snmpTargetAddrTable

Claus Klein <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I think the address encoding is wrong!
This is a valid configuration:

claus-kleins-macbook-pro:~ clausklein$ snmpwalk 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)

claus-kleins-macbook-pro:~ clausklein$ snmpwalk localhost  
targetparamstable
SNMP-TARGET-MIB::snmpTargetParamsMPModel.'internal0' = INTEGER: 1
SNMP-TARGET-MIB::snmpTargetParamsSecurityModel.'internal0' = INTEGER: 2
SNMP-TARGET-MIB::snmpTargetParamsSecurityName.'internal0' = STRING:  
public
SNMP-TARGET-MIB::snmpTargetParamsSecurityLevel.'internal0' = INTEGER:  
noAuthNoPriv(1)
SNMP-TARGET-MIB::snmpTargetParamsStorageType.'internal0' = INTEGER:  
readOnly(5)
SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'internal0' = INTEGER:  
active(1)

claus-kleins-macbook-pro:~ clausklein$ snmpwalk localhost  
targetaddrtable
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: 1000
SNMP-TARGET-MIB::snmpTargetAddrRetryCount.'internal0' = INTEGER: 5
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)
claus-kleins-macbook-pro:~ clausklein$

I hope this helps
Claus

On 31.08.2010, at 12:28, rakesh zingade wrote:

>
> Hi all,
>
> I am trying to add trap destination using combination of  
> snmpNotifyTable and snmpTargetAddrTable entities. But the agent  
> seems not entertaining the config that I did. Can you please suggest  
> whats wrong I did and is there something extra needed for adding  
> trap dest?
>
> I am executing following script to set snmpNotifyTable,  
> snmpTargetAddrTable and snmpTargetParamsTable. I refered http://www.ietf.org/rfc/rfc2573.txt
>
> script:
>
> #!/bin/bash
>
> TargetAddrName=addr1;
> DEST="127.0.0.1:162"
>
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-NOTIFICATION- 
> MIB::snmpNotifyRowStatus.\'$TargetAddrName\' i 5 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-NOTIFICATION- 
> MIB::snmpNotifyTag.\'$TargetAddrName\' s "$TargetAddrName" 2>/dev
> /null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrRowStatus.\'$TargetAddrName\' i 5 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrTDomain.\'$TargetAddrName\' o ".1.3.6.1.6.1.1" 2>/ 
> de
> v/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrTAddress.\'$TargetAddrName\' s "$DEST" 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-NOTIFICATION- 
> MIB::snmpNotifyRowStatus.\'$TargetAddrName\' i 1 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-NOTIFICATION- 
> MIB::snmpNotifyStorageType.\'$TargetAddrName\' i 1 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrParams.\'$TargetAddrName\' s "$TargetAddrName" 2>/ 
> de
> v/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrRowStatus.\'$TargetAddrName\' i 1 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetAddrTagList.\'$TargetAddrName\' s "$TargetAddrName"  
> 2>/d
> ev/null
>
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsRowStatus.\'$TargetAddrName\' i 5 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsMPModel.\'$TargetAddrName\' i 1 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsSecurityModel.\'$TargetAddrName\' i 2 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsSecurityName.\'$TargetAddrName\' s "public" 2>/ 
> dev
> /null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsSecurityLevel.\'$TargetAddrName\' i 1 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsStorageType.\'$TargetAddrName\' i 5 2>/dev/null
> snmpset -m all -v2c -c private 127.0.0.1 SNMP-TARGET- 
> MIB::snmpTargetParamsRowStatus.\'$TargetAddrName\' i 1 2>/dev/null
> echo "added snmp target $TargetAddrName"
> echo "walk on Target Table"
> snmpwalk -m all -v2c -c public 127.0.0.1 .1.3.6.1.6.3.12.1.2 2>/dev/ 
> null
> echo
> echo "walk on notify table"
> snmpwalk -m all -v2c -c public localhost .1.3.6.1.6.3.13.1.1 2>/dev/ 
> null
> echo
> echo "walk on target param tables"
> snmpwalk -m all -v2c -c public localhost .1.3.6.1.6.3.12.1.3 2>/dev/ 
> null
>
>
> The response is:
>  SNMP-NOTIFICATION-MIB::snmpNotifyRowStatus.'addr1' = INTEGER:  
> createAndWait(5)
> SNMP-NOTIFICATION-MIB::snmpNotifyTag.'addr1' = STRING: addr1
> SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'addr1' = INTEGER:  
> createAndWait(5)
> SNMP-TARGET-MIB::snmpTargetAddrTDomain.'addr1' = OID: SNMPv2- 
> TM::snmpUDPDomain
> SNMP-TARGET-MIB::snmpTargetAddrTAddress.'addr1' = STRING:  
> "127.0.0.1:162"
> SNMP-NOTIFICATION-MIB::snmpNotifyRowStatus.'addr1' = INTEGER:  
> active(1)
> SNMP-NOTIFICATION-MIB::snmpNotifyStorageType.'addr1' = INTEGER:  
> other(1)
> SNMP-TARGET-MIB::snmpTargetAddrParams.'addr1' = STRING: addr1
> SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'addr1' = INTEGER: active(1)
> SNMP-TARGET-MIB::snmpTargetAddrTagList.'addr1' = STRING: addr1
> SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'addr1' = INTEGER:  
> createAndWait(5)
> SNMP-TARGET-MIB::snmpTargetParamsMPModel.'addr1' = INTEGER: 1
> SNMP-TARGET-MIB::snmpTargetParamsSecurityModel.'addr1' = INTEGER: 2
> SNMP-TARGET-MIB::snmpTargetParamsSecurityName.'addr1' = STRING: public
> SNMP-TARGET-MIB::snmpTargetParamsSecurityLevel.'addr1' = INTEGER:  
> noAuthNoPriv(1)
> SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'addr1' = INTEGER:  
> active(1)
> added snmp target addr1
> walk on Target Table
> SNMP-TARGET-MIB::snmpTargetAddrTDomain.'addr1' = OID: SNMPv2- 
> TM::snmpUDPDomain
> SNMP-TARGET-MIB::snmpTargetAddrTAddress.'addr1' = STRING:  
> "127.0.0.1:162"
> SNMP-TARGET-MIB::snmpTargetAddrTimeout.'addr1' = INTEGER: 1500
> SNMP-TARGET-MIB::snmpTargetAddrRetryCount.'addr1' = INTEGER: 3
> SNMP-TARGET-MIB::snmpTargetAddrTagList.'addr1' = STRING: addr1
> SNMP-TARGET-MIB::snmpTargetAddrParams.'addr1' = STRING: addr1
> SNMP-TARGET-MIB::snmpTargetAddrStorageType.'addr1' = INTEGER:  
> nonVolatile(3)
> SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'addr1' = INTEGER: active(1)
>
> walk on notify table
> SNMP-NOTIFICATION-MIB::snmpNotifyTag.'addr1' = STRING: addr1
> SNMP-NOTIFICATION-MIB::snmpNotifyType.'addr1' = INTEGER: trap(1)
> SNMP-NOTIFICATION-MIB::snmpNotifyStorageType.'addr1' = INTEGER:  
> other(1)
> SNMP-NOTIFICATION-MIB::snmpNotifyRowStatus.'addr1' = INTEGER:  
> active(1)
>
> walk on target param tables
> SNMP-TARGET-MIB::snmpTargetParamsMPModel.'addr1' = INTEGER: 1
> SNMP-TARGET-MIB::snmpTargetParamsSecurityModel.'addr1' = INTEGER: 2
> SNMP-TARGET-MIB::snmpTargetParamsSecurityName.'addr1' = STRING: public
> SNMP-TARGET-MIB::snmpTargetParamsSecurityLevel.'addr1' = INTEGER:  
> noAuthNoPriv(1)
> SNMP-TARGET-MIB::snmpTargetParamsStorageType.'addr1' = INTEGER: 0
> SNMP-TARGET-MIB::snmpTargetParamsRowStatus.'addr1' = INTEGER:  
> active(1)
>
> Thanks and Regards...
>
> -- 
> Rakesh P. Zingade
> +919420626099
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd_______________________________________________
> 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

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd

_______________________________________________
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.