回复: what wrong with my mib2 c.iterate.conf generate .c fil e???
"飞飞" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I thank your are right,But the result is NOT my really want. I defined a table in my MIB,used mib2c.iterate.conf generate .c file,and I modified it. I really want is when I use snmpwalk command the subagent can return to me a table structure data(alse use get,getnext). My .c code file has something wrong where I cannot recognize it.Help me Dave,or tell me what I need to modify it. :=) ------------------ 原始邮件 ------------------ 发件人: "Dave Shield"<[email protected]>; 发送时间: 2009年12月8日(星期二) 下午5:46 收件人: "飞飞"<[email protected]>; 抄送: "net-snmp-users"<[email protected]>; 主题: Re: what wrong with my mib2c.iterate.conf generate .c file??? 2009/12/8 飞飞 <[email protected]>: > I really think I have done my mib2c file job,but the MgG-soft brower's > result dispirit me heavily. > > I got: > > 2464: enterprises.30901.2090.7000.1.1.1.1.111 (gauge) 111 > 2465: enterprises.30901.2090.7000.1.1.1.2.111 (gauge) 111 > 2466: enterprises.30901.2090.7000.1.1.1.3.111 (gauge) 111 > 2467: enterprises.30901.2090.7000.1.1.1.4.111 (gauge) 1 > 2468: enterprises.30901.2090.7000.1.1.1.5.111 (integer) 1 > 2469: enterprises.30901.2090.7000.1.1.1.6.111 (gauge) 1 > 2470: enterprises.30901.2090.7000.1.1.1.7.111 (integer) 1 > 2471: enterprises.30901.2090.7000.1.1.1.8.111 (integer) 1 > 2472: enterprises.30901.2090.7000.1.1.1.9.111 (integer) 1 > 2473: enterprises.30901.2090.7000.1.1.1.10.111 (gauge) 1 > 2474: enterprises.30901.2090.7000.1.1.1.11.111 (gauge) 1 > 2475: enterprises.30901.2090.7000.1.1.1.12.111 (octet string) uituits > 2476: enterprises.30901.2090.7000.1.1.1.13.111 (octet string) uituits > 2477: enterprises.30901.2090.7000.1.1.1.14.111 (octet string) uituits > 2478: enterprises.30901.2090.7000.1.1.1.15.111 (octet string) uituits > 2479: enterprises.30901.2090.7000.1.1.1.16.111 (octet string) uituits OK - so that looks like a table rooted at enterprises.30901.2090.7000.1.1, with sixteen columns (numbered 1-16), and one row (with index 111) The first 3 columns of this (sole) row have the value 111, the next 8 have the value 1, and the last five have the value "uituits" > It is so weird,my .c file is: > static oid diskSystemTable_oid[] = {1,3,6,1,4,1,30901,2090,7000,1,1}; > size_t diskSystemTable_oid_len = OID_LENGTH(diskSystemTable_oid); > reg = netsnmp_create_handler_registration( > "diskSystemTable", diskSystemTable_handler, > diskSystemTable_oid, diskSystemTable_oid_len, > HANDLER_CAN_RONLY > ); > netsnmp_register_table_iterator( reg, iinfo ); So you're registering a table with root .1.3.6.1.4.1.30901.2090.7000.1.1 > diskSystemTable_createEntry(111,111,111, 1,1,1,1,1,1,1,1,"uituits", > 7,"uituits", 7,"uituits", 7,"uituits", 7,"uituits", 7); and initialising this with a single row, containing three columns of 111, eight columns of 1, and five columns of "uituits". So what you see when you walk the table is exactly what you are setting up in the code. What's the problem? Dave ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ 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