Ptoblem to use snmpget

2019-12-04 Thread diego dinarte
Hello, when i use the following command, i have the following problem
(ubuntu 64 bits):

snmpget -v 2c -c   .1.3.6.1.4.1.15004.4.10.2.2.2.2.2.1.2
Error in packet
Reason: wrongLength (The set value has an illegal length from what the
agent expects)
Failed object: iso.3.6.1.4.1.15004.4.10.2.2.2.2.2.1.2

How can i solve it, thanks in advance.

-- 
diegod...@gmail.com
*Diego Dinarte*


___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


snmpd crash when started with udp, dltsudp, tlstcp

2019-12-04 Thread Larry Hayes
I am running net-snmp 5.8 r0.

I can get snmpd, snmptrapd and snmpget working with dtlsudp and tlstcp.
Except for some corner cases:

If I have a trap session defined in the snmpd.conf file, but the snmptrapd
is not running.
snmpd gets a SIGSEGV at startup time. (If I start snmptrapd first, then
everything works)

snmpd.local.conf:

trapsess -v 3 -T their_identity=manager.crt  tlstcp:10.20.19.57:10162
certSecName 1 04:BF:CF:1A:9C:5D:7A:9D:87:7E:1D:D8:A3:77:1A:DD:D7:76:77:0B
--sn "AdminUser"

snmpd start up:
/usr/sbin/snmpd -f
-Dsnmpd/select,snmp_store,snmp_alarm,snmp_agent,verbose:asp -Losd udp:
0.0.0.0:161 dtlsudp:10161 tlstcp:10161

Anybody seen this or got a work around

registered debug token snmpd/select, 1
registered debug token snmp_store, 1
registered debug token snmp_alarm, 1
registered debug token snmp_agent, 1
registered debug token verbose:asp, 1
Log handling defined - disabling stderr
snmp_alarm: registered alarm 1, t = 10.000, flags=0x01
snmp_alarm: registered alarm 2, t = 3.000, flags=0x01
snmp_alarm: registered alarm 3, t = 5.000, flags=0x01
Turning on AgentX master support.
tlstcp: failed to connect to 10.20.19.57:10162
 OpenSSL Related Errors: 
 error: #151584876 (file ../openssl-1.1.1d/crypto/pem/pem_lib.c, line 745)
  Textual Error: Expecting: ANY PRIVATE KEY
 error: #33562735 (file ../openssl-1.1.1d/crypto/bio/b_sock2.c, line 110)
 error: #537436263 (file ../openssl-1.1.1d/crypto/bio/b_sock2.c, line 111)
 error: #33562735 (file ../openssl-1.1.1d/crypto/bio/bss_conn.c, line 173)
  Textual Error: hostname=10.20.19.57 service=10162
 error: #537342055 (file ../openssl-1.1.1d/crypto/bio/bss_conn.c, line 177)
 End of OpenSSL Errors 
snmp_alarm: no alarms found to schedule
snmp_agent: final port spec: "udp:0.0.0.0:161,dtlsudp:10161,tlstcp:10161"
snmp_agent: installing master agent on port udp:0.0.0.0:161
snmp_agent: init_master_agent; "udp:0.0.0.0:161" registered as an agent NSAP
snmp_agent: installing master agent on port dtlsudp:10161
A SNMP version other than 3 was requested with (D)TLS; using 3 anyways
snmp_agent: init_master_agent; "dtlsudp:10161" registered as an agent NSAP
snmp_agent: installing master agent on port tlstcp:10161
snmp_agent: init_master_agent; "tlstcp:10161" registered as an agent NSAP
snmp_store: storing stuff...
NET-SNMP version 5.8
snmpd/select: select( numfds=10, ..., tvp=0xd4f0)
snmpd/select: returned, count = 1
snmpd/select: select( numfds=10, ..., tvp=0xd4f0)
snmpd/select: returned, count = 1
snmpd/select: select( numfds=10, ..., tvp=0xd4f0)
snmpd/select: returned, count = 0

Program received signal SIGSEGV, Segmentation fault.
0xf7d38dfa in snmp_sess_timeout (sessp=0x809c7d8) at snmp_api.c:6789
6789snmp_api.c: No such file or directory.
(gdb) bt
#0  0xf7d38dfa in snmp_sess_timeout (sessp=0x809c7d8) at snmp_api.c:6789
#1  0xf7d38fa9 in snmp_timeout () at snmp_api.c:6660
#2  0x0804b50f in receive () at snmpd.c:1347
#3  0x0804ab52 in main (argc=7, argv=0xd7b4) at snmpd.c:1125
(gdb) print sptr
$1 = 
(gdb) print rp
$2 = (netsnmp_request_list *) 0x80d13d8
(gdb) print now
$3 = {tv_sec = 83215, tv_usec = 331554}
(gdb) print rp->pdu->securityModel
Cannot access memory at address 0x28
(gdb) print rp->expireM
$4 = {tv_sec = 0, tv_usec = 0}
(gdb) print rp->pdu
$5 = (netsnmp_pdu *) 0x0
(gdb)
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: HEX- String instead of Octet - String - incase of inetAddress

2019-12-04 Thread Niels Baggesen via Net-snmp-coders
On Tue, Dec 03, 2019 at 04:45:30PM +, Bek, Anshul wrote:
> 
> For 9.9.156.1.1.2.1.7.1 and 9.9.156.1.1.2.1.7.2, its basically an InetAddress.
> 
> I have 2 queries:
> 
> 
>   1.  Is there any way to get only these 2 InetAddress as Hex-string. I can 
> see that  in sprint_realloc_octet_string() in snmplib/mib.c involves in 
> sprinting OCTET STRINGS for snmpgets and walks. Is there any value to check ? 
> Also  hints, enums and units passed in NULL.
>   2.  Why is the IP display in this manner ie. each octet in ascii . Is it by 
> default ?
> 
> Note:- I don't want to use -Ox option as this will display all the strings 
> value in Hex.

They are display that way because Cisco intended this to be a host name
and then it makes sense that it is a string.

They are defined like this

$ snmptranslate -Td -m ALL SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.2.1
CISCO-CCM-MIB::ccmName.1
ccmName OBJECT-TYPE
  -- FROM   CISCO-CCM-MIB
  -- TEXTUAL CONVENTION SnmpAdminString
  SYNTAXOCTET STRING (0..128) 
  DISPLAY-HINT  "255t"
  MAX-ACCESSread-only
  STATUScurrent
  DESCRIPTION   "The host name of the CallManager."
::= { iso(1) org(3) dod(6) internet(1) private(4)
  enterprises(1) cisco(9) ciscoMgmt(9) ciscoCcmMIB(156)
  ciscoCcmMIBObjects(1) ccmGeneralInfo(1) ccmTable(2)
  ccmEntry(1) ccmName(2) 1 }
  
/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming


___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders