Maximum size of OID and SNMP packet
Hi All, I wish to know if I wish to construct a SNMP PDU with all OIDs in that PDU as Octet string, then how many OIDs I can give in a PDU. Also, what will be length of each OCTET STRING for each OID I can give. e.g. testString OBJECT-TYPE SYNTAX OCTET STRING (SIZE (1..65535)) MAX-ACCESS read-write STATUS current DESCRIPTION Test String If this is the OID which I want to send in a PDU for snmpset then what will be the maximum string length I can give for this MIB. Is SNMP_MAX_MSG_SIZE is for whole pdu or for a OID? Thanks in advance. Thanks and Rgds, Sandeep --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Fw: How to get data in table through C code?
- Original Message - From: Gary Clark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 02, 2005 8:23 AM Subject: Re: How to get data in table through C code? Hello All, Ha-hum! please read the FAQ this is an excellent starting point to understand what the hell is going on. The simplest approach at least I found, was to your construct MIB table entries using ASN.1 notation and then use the magical mib2c to construct your tables into c template code. This is also explained in the FAQ. Thanks, Garyc PS Try to make your life simple. - Original Message - From: [EMAIL PROTECTED] To: net-snmp-users net-snmp-users@lists.sourceforge.net Sent: Saturday, April 30, 2005 5:19 AM Subject: How to get data in table through C code? dear all: In the example: data_set.c, it showed how to set some row of a table through c code. Now I want to know how to get some column value in the table throught c code. For example, in the data_set.c, I want to get the value of column 2: IETFWGChair1 in snmpv3 row through C code. What can I do? And what function should I use ? Thank you very much!! [EMAIL PROTECTED] ?z{l??x(?(!z?r???!1?f????sD ??i?X ? ??? 0??? (???^' ? ??x%?Mz??b??qYh???r?z??? ? z??'m?q-b??z???
Sending traps
Hello, I need to calculate the network utilization that my agent uses when sending notification traps to the manager. Is there a way to calculate the amount of bytes used by a trap? Thanks a lot. Mauricio. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
AGENT EXT SIT ON NAILS - 10
Dear Sir, i am thankful to Mr.DAVE sir for his advice. Sir, Mr.DAVE at last i am able to send a SNMPTRAP now..sir, sorry for delay. [ AGENT EXT SIT ON NAILS-9 ] sir, as per your advice i studied the FAQ again and again and now i am able to send a trap for my WMAN-IF-MIB integrated agent.for this i have written a new MIB file having a NOTIFICATION-TYPE only.and named it asWiMAX-NOTIFICATION-TEST-MIB copy paste of terminal is given below. = [EMAIL PROTECTED] net-snmp-5.2]$ snmptrap -v 2c -c necops 172.29.5.102:1 950 '' WIMAX-NOTIFICATION-TEST-MIB::demonotifs \1.3.6.1.2.1.10.184.1.1.5.3.1.1 i 777 [EMAIL PROTECTED] net-snmp-5.2]$ snmptrap -v 2c -c necops 172.29.5.102:1 950 '' WIMAX-NOTIFICATION-TEST-MIB::demonotifs \1.3.6.1.2.1.10.184.1.1.5.3.1.2 i 7676 [EMAIL PROTECTED] net-snmp-5.2]$ [EMAIL PROTECTED] apps]$ ./snmptrapd -f -Le 172.29.5.102:1950 Warning: no access control information configured. It's unlikely this agent can serve any useful purpose in this state. Run snmpconf -g basic_setup to help you configure the snmptrapd.conf file fo r this agent. 2005-05-02 16:31:45 NET-SNMP version 5.2 Started. 2005-05-02 20:02:39 172.29.5.102 [UDP: [172.29.5.102]:35145]: SNMPv2-MIB::sysUpTime.0 = Timeticks: (88205049) 10 days, 5:00:50.49 SNMPv2-M IB::snmpTrapOID.0 = OID: SNMPv2-SMI::transmission.184.25SNMPv2-SMI::tran smission.184.1.1.5.3.1.1 = INTEGER: 777 2005-05-02 20:19:05 172.29.5.102 [UDP: [172.29.5.102]:35147]: SNMPv2-MIB::sysUpTime.0 = Timeticks: (88303593) 10 days, 5:17:15.93 SNMPv2-M IB::snmpTrapOID.0 = OID: SNMPv2-SMI::transmission.184.25SNMPv2-SMI::tran smission.184.1.1.5.3.1.2 = INTEGER: 7676 = sir, but a request many of the contents are bit technically COMPLEX where me like students are NOT able understand at a SINGLE READ. sir, now my NEW queries are... sir, i infact studied the faq and the online material and doubt lies here. sir, i studies NET-SNMP TUTORIAL -TRAPS given in the WEBSITE[ONLINE DOCUMENTATION] sir, now i want to EXCUTE OTHER PROGRAM ON RECEPTION OF A TRAP. say, a SHELL SCRIPT. 1) WHERE TO PLACE THE SHELL SCRIPT PROGRAM.? 2) WHERE TO LOCATE SNMPTRAPD.CONF FILE FIRST? 3) HOW TO INCLUDE THE SHELL SCRIPT PROGRAM FILE NAME INSIDE THE SNMPTRAPD.CONF? sir, please do kindly say me, i cannot understand that page well. sir, my SECOND QUERY: sir, when snmptrapd logs the traps send by snmptrap here, it is NOT SHOWING MY MIB NAME [WMAN-IF-MIB] INSTEAD IT SHOWS THE PARENT NODE OR THE ROOT NODE NAMEBELOW IS COPY PASTE OF IT... == 2005-05-02 20:19:05 172.29.5.102 [UDP: [172.29.5.102]:35147]: SNMPv2-MIB::sysUpTime.0 = Timeticks: (88303593) 10 days, 5:17:15.93 SNMPv2-M IB::snmpTrapOID.0 = OID: SNMPv2-SMI::transmission.184.25SNMPv2-SMI::tran smission.184.1.1.5.3.1.2 = INTEGER: 7676 = see here, in the received trap message, it shows SNMPV2-SMI::transmission.184.25 here it should actually should show me the MIB file name as WIMAX-NOTIFICATION-TEST-MIB and also for SNMPv2-SMI::transmission.184.1.1.5.3.1.2 should be as WMAN-IF-MIB::wmanIfBsControllerActionsResetSector WHY? WHAT TO DO FOR CHANGING IT? sir, i wish to be your student always.. as it is very interesting to work with SNMP and WiMAX on your guidelines... thanks a lot for considering my requests. with sincere thanks love, n.parthiban
Re: agent crash when proxying for Squid
John Hardin wrote: I have a system where I set up Net-SNMP to proxy for Squid (the caching software). Squid is running on the same machine as Net-SNMP. Its agent is integrated into its cache daemon and only understands SNMPv1, so I have Squid's agent listening on 127.0.0.1:3401. The snmpd.conf file I give to the Net-SNMP agent contains this line: proxy -v 1 -c public 127.0.0.1:3401 .1.3.6.1.4.1.3495 The problem occurs when I do a bulk get for a couple of objects from Squid. It seems to be any two or more objects. (A single object will work ok, but why do buld get on one object. :-) Below is a trace from the agent. I'm running the agent on port 32000 instead of 161 only to isolate it from any other SNMP requests (for example HP OV doing discovery). I'm runing the agent on a Linux box running kernel 2.4.26. $ /usr/sbin/snmpd -c /etc/snmp/snmpd.conf -C -f -d -p -Lo 10.1.0.36:32000 NET-SNMP version 5.2.1 Received 61 bytes from UDP: [10.1.2.10]:36951 : 30 3B 02 01 01 04 06 70 75 62 6C 69 63 A5 2E 02 0;.public... 0016: 04 20 90 02 54 02 01 02 02 01 00 30 20 30 0E 06. ..T..0 0.. 0032: 0A 2B 06 01 04 01 9B 27 01 01 01 05 00 30 0E 06 .+.'.0.. 0048: 0A 2B 06 01 04 01 9B 27 01 01 02 05 00 .+.'. Received SNMP packet(s) from UDP: [10.1.2.10]:36951 GETBULK message, non-rep=2, max_rep=0 -- SNMPv2-SMI::enterprises.3495.1.1.1 -- SNMPv2-SMI::enterprises.3495.1.1.2 Sending 61 bytes to UDP: [127.0.0.1]:3401 : 30 3B 02 01 00 04 06 70 75 62 6C 69 63 A1 2E 02 0;.public... 0016: 04 63 1C A3 89 02 01 00 02 01 00 30 20 30 0E 06 .c.0 0.. 0032: 0A 2B 06 01 04 01 9B 27 01 01 01 05 00 30 0E 06 .+.'.0.. 0048: 0A 2B 06 01 04 01 9B 27 01 01 02 05 00 .+.'. Received 55 bytes from UDP: [127.0.0.1]:3401 : 30 82 00 33 02 01 00 04 06 70 75 62 6C 69 63 A2 0..3.public. 0016: 82 00 24 02 04 63 1C A3 89 02 01 00 02 01 00 30 ..$..c.0 0032: 82 00 14 30 82 00 10 06 0B 2B 06 01 04 01 9B 27 ...0.+.' 0048: 01 01 01 00 02 01 54 ..T response to proxy request illegal. We're screwed. Received 61 bytes from UDP: [10.1.2.10]:36951 : 30 3B 02 01 01 04 06 70 75 62 6C 69 63 A5 2E 02 0;.public... 0016: 04 20 90 02 54 02 01 02 02 01 00 30 20 30 0E 06. ..T..0 0.. 0032: 0A 2B 06 01 04 01 9B 27 01 01 01 05 00 30 0E 06 .+.'.0.. 0048: 0A 2B 06 01 04 01 9B 27 01 01 02 05 00 .+.'. Received SNMP packet(s) from UDP: [10.1.2.10]:36951 Segmentation fault Heres the command I use to reproduce this: snmpbulkget -c public -v2c -Cn2 -Cr0 myserver:32000 \ SNMPv2-SMI::enterprises.3495.1.1.1 \ SNMPv2-SMI::enterprises.3495.1.1.2 I haven't hand-decoded the traffic above, yet, but thought I'd share what I have so far. Please let me know if this is a known issue. Thanks. -John Apparently the BULK-GET received by snmpd is sent to Squid as a GET-NEXT with two OIDs. Ethereal reports this: Version: 1 (0) Community: public PDU type: GET-NEXT (1) Request Id: 0x60962325 Error Status: NO ERROR (0) Error Index: 0 Object identifier 1: 1.3.6.1.4.1.3495.1.1.1 (SNMPv2-SMI::enterprises.3495.1.1.1) Value: NULL Object identifier 2: 1.3.6.1.4.1.3495.1.1.2 (SNMPv2-SMI::enterprises.3495.1.1.2) Value: NULL Squid responds with this: Version: 1 (0) Community: public PDU type: RESPONSE (2) Request Id: 0x60962325 Error Status: NO ERROR (0) Error Index: 0 Object identifier 1: 1.3.6.1.4.1.3495.1.1.1.0 (SNMPv2-SMI::enterprises.3495.1.1.1.0) Value: INTEGER: 84 It looks like the agent then segfaults when the snmpbulkget retries. --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: agent crash when proxying for Squid
On Mon, 02 May 2005 13:12:47 -0700, John Hardin [EMAIL PROTECTED] said: John Apparently the BULK-GET received by snmpd is sent to Squid as John a GET-NEXT with two OIDs. Ethereal reports this: John Version: 1 (0) John Community: public John PDU type: GET-NEXT (1) John Request Id: 0x60962325 John Error Status: NO ERROR (0) John Error Index: 0 John Object identifier 1: 1.3.6.1.4.1.3495.1.1.1 John (SNMPv2-SMI::enterprises.3495.1.1.1) John Value: NULL John Object identifier 2: 1.3.6.1.4.1.3495.1.1.2 John (SNMPv2-SMI::enterprises.3495.1.1.2) John Value: NULL John Squid responds with this: John Version: 1 (0) John Community: public John PDU type: RESPONSE (2) John Request Id: 0x60962325 John Error Status: NO ERROR (0) John Error Index: 0 John Object identifier 1: 1.3.6.1.4.1.3495.1.1.1.0 John (SNMPv2-SMI::enterprises.3495.1.1.1.0) John Value: INTEGER: 84 John It looks like the agent then segfaults when the snmpbulkget John retries. hmmm... lame that it's only returning one varbind when 2 were requested! not that anything should crash when this happens, mind you... -- Wes Hardaker Sparta, Inc. --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: agent crash when proxying for Squid
On Mon, 02 May 2005 13:12:47 -0700, John Hardin [EMAIL PROTECTED] said: John It looks like the agent then segfaults when the snmpbulkget retries. This code should have been executed in that case. Did you see this message in your log: if (request || var) { /* * ack, this is bad. The # of varbinds don't match and * there is no way to fix the problem */ if (pdu) snmp_free_pdu(pdu); snmp_log(LOG_ERR, response to proxy request illegal. We're screwed.\n); netsnmp_set_request_error(cache-reqinfo, requests, SNMP_ERR_GENERR); } -- Wes Hardaker Sparta, Inc. --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: agent crash when proxying for Squid
Wes Hardaker wrote: On Mon, 02 May 2005 13:12:47 -0700, John Hardin [EMAIL PROTECTED] said: John Apparently the BULK-GET received by snmpd is sent to Squid as John a GET-NEXT with two OIDs. Ethereal reports this: John Version: 1 (0) John Community: public John PDU type: GET-NEXT (1) John Request Id: 0x60962325 John Error Status: NO ERROR (0) John Error Index: 0 John Object identifier 1: 1.3.6.1.4.1.3495.1.1.1 John (SNMPv2-SMI::enterprises.3495.1.1.1) John Value: NULL John Object identifier 2: 1.3.6.1.4.1.3495.1.1.2 John (SNMPv2-SMI::enterprises.3495.1.1.2) John Value: NULL John Squid responds with this: John Version: 1 (0) John Community: public John PDU type: RESPONSE (2) John Request Id: 0x60962325 John Error Status: NO ERROR (0) John Error Index: 0 John Object identifier 1: 1.3.6.1.4.1.3495.1.1.1.0 John (SNMPv2-SMI::enterprises.3495.1.1.1.0) John Value: INTEGER: 84 John It looks like the agent then segfaults when the snmpbulkget John retries. hmmm... lame that it's only returning one varbind when 2 were requested! not that anything should crash when this happens, mind you... Yes, lame. I've found the code in Squid that responds to SNMP requests and, sure enough, if it's a GET it will loop through all the OIDs but if it's a GETNEXT it just assumes a single OID. If I get the fix working I'll submit it the the Squid folks. --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: agent crash when proxying for Squid
Wes Hardaker wrote: On Mon, 02 May 2005 13:12:47 -0700, John Hardin [EMAIL PROTECTED] said: John It looks like the agent then segfaults when the snmpbulkget retries. This code should have been executed in that case. Did you see this message in your log: if (request || var) { /* * ack, this is bad. The # of varbinds don't match and * there is no way to fix the problem */ if (pdu) snmp_free_pdu(pdu); snmp_log(LOG_ERR, response to proxy request illegal. We're screwed.\n); netsnmp_set_request_error(cache-reqinfo, requests, SNMP_ERR_GENERR); } Yes, I do see this. (It's there in my perhaps overly lengthy 1st msg.) I've been looking at this code for something left in a strange state but I don't see anything yet. --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: agent crash when proxying for Squid
John Hardin wrote: Wes Hardaker wrote: On Mon, 02 May 2005 13:12:47 -0700, John Hardin [EMAIL PROTECTED] said: John It looks like the agent then segfaults when the snmpbulkget retries. This code should have been executed in that case. Did you see this message in your log: if (request || var) { /* * ack, this is bad. The # of varbinds don't match and * there is no way to fix the problem */ if (pdu) snmp_free_pdu(pdu); snmp_log(LOG_ERR, response to proxy request illegal. We're screwed.\n); netsnmp_set_request_error(cache-reqinfo, requests, SNMP_ERR_GENERR); } Yes, I do see this. (It's there in my perhaps overly lengthy 1st msg.) I've been looking at this code for something left in a strange state but I don't see anything yet. I again but without using the bulkget. Instead I sent an SNMPv1 getnext for the same two OIDs to snmpd. Same problem. Here's a trace from just before the we're screwed log: trace: proxy_got_response(): ucd-snmp/proxy.c, 519: proxy: got response... SNMPv2-SMI::enterprises.3495.1.1.1.0 response to proxy request illegal. We're screwed. trace: _sess_read(): snmp_api.c, 5289: sess_read: not reading 8 (fdset 0xbfffe0f0 set 0) trace: _sess_read(): snmp_api.c, 5289: sess_read: not reading 6 (fdset 0xbfffe0f0 set 0) trace: _sess_read(): snmp_api.c, 5289: sess_read: not reading 4 (fdset 0xbfffe0f0 set 0) trace: snmp_sess_select_info(): snmp_api.c, 5701: sess_select: for all sessions: 12 10 11 8 6 4 sess_select: next alarm -1073750920.1075483508 sec sess_select: blocking:no session requests or alarms. trace: receive(): snmpd.c, 1114: snmpd/select: select( numfds=13, ..., tvp=(nil)) trace: receive(): snmpd.c, 1119: snmpd/select: returned, count = 1 trace: netsnmp_udp_recv(): snmpUDPDomain.c, 132: netsnmp_udp: recvfrom fd 12 got 61 bytes (from UDP: [127.0.0.1]:32776) trace: _sess_process_packet(): snmp_api.c, 4971: sess_process_packet: session 0x8100940 fd 12 pkt 0x81267b0 length 61 Received 61 bytes from UDP: [127.0.0.1]:32776 : 30 3B 02 01 00 04 06 70 75 62 6C 69 63 A1 2E 020;.public... 0016: 04 47 CD 03 D5 02 01 00 02 01 00 30 20 30 0E 06.G.0 0.. 0032: 0A 2B 06 01 04 01 9B 27 01 01 01 05 00 30 0E 06.+.'.0.. 0048: 0A 2B 06 01 04 01 9B 27 01 01 02 05 00 .+.'. Received SNMP packet(s) from UDP: [127.0.0.1]:32776 dumpx_recv:02 01 00 dumpv_recv: Integer: 0 (0x00) trace: _snmp_parse(): snmp_api.c, 4024: snmp_api: Parsing SNMPv1 message... trace: _snmp_parse(): snmp_api.c, 4031: dumph_recv: SNMPv1 message trace: snmp_comstr_parse(): snmp_auth.c, 132: dumph_recv: SNMP version dumpx_recv:02 01 00 dumpv_recv: Integer: 0 (0x00) trace: snmp_comstr_parse(): snmp_auth.c, 144: dumph_recv: community string dumpx_recv:04 06 70 75 62 6C 69 63 dumpv_recv: String:public trace: _snmp_parse(): snmp_api.c, 4074: dumph_recv: PDU trace: snmp_pdu_parse(): snmp_api.c, 4260: dumph_recv: request_id dumpx_recv: 02 04 47 CD 03 D5 dumpv_recv:Integer: 1204618197 (0x47CD03D5) trace: snmp_pdu_parse(): snmp_api.c, 4271: dumph_recv: error status dumpx_recv: 02 01 00 dumpv_recv:Integer: 0 (0x00) trace: snmp_pdu_parse(): snmp_api.c, 4282: dumph_recv: error index dumpx_recv: 02 01 00 dumpv_recv:Integer: 0 (0x00) trace: snmp_pdu_parse(): snmp_api.c, 4300: dumph_recv: VarBindList trace: snmp_pdu_parse(): snmp_api.c, 4330: dumph_recv: VarBind trace: snmp_parse_var_op(): snmp.c, 166: dumph_recv: Name dumpx_recv: 06 0A 2B 06 01 04 01 9B 27 01 01 01 dumpv_recv:ObjID: SNMPv2-SMI::enterprises.3495.1.1.1 trace: snmp_pdu_parse(): snmp_api.c, 4339: dumph_recv: Value trace: snmp_pdu_parse(): snmp_api.c, 4330: dumph_recv: VarBind trace: snmp_parse_var_op(): snmp.c, 166: dumph_recv: Name dumpx_recv: 06 0A 2B 06 01 04 01 9B 27 01 01 02 dumpv_recv:ObjID: SNMPv2-SMI::enterprises.3495.1.1.2 trace: snmp_pdu_parse(): snmp_api.c, 4339: dumph_recv: Value GETNEXT message -- SNMPv2-SMI::enterprises.3495.1.1.1 -- SNMPv2-SMI::enterprises.3495.1.1.2 trace: init_agent_snmp_session(): snmp_agent.c, 1244: snmp_agent: agent_sesion 0x80f18c0 created Segmentation fault --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: