default net-snmp5.1.2 setup
I add one mib in mib-dir. "export MIBS=ALL" "mib2c A0DV" create "AODV.c AODV.h" and modify the c file. "gcc -g -c -o AODV.o AODV.c" "gcc -g -fPIC -shared -o AODV.so AODV.o" "vi /etc/snmp/snmpd.conf" "dlmod AODV /dir/AODV.so" restart snmpd
But snmpget -v 2c -c public 192.168.200.109 1.3.6.1.4.1.2345.1.2 AODV-MIB::RREQ = No Such Object available on this agent at this OID
Could u help me and tell why ? mib and mib.c attached in the following
#########AODV-MIB.txt###################### AODV-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY,OBJECT-TYPE,Integer32, Counter32 enterprises FROM SNMPv2-SMI;
AODV-MIB MODULE-IDENTITY
LAST-UPDATED "0305040000Z"
ORGANIZATION "STAR HUAZHONG INVESTIGATION CENTER"
CONTACT-INFO
""
DESCRIPTION
"The MIB module for variables of AODV"
REVISION "0104160000Z"
DESCRIPTION
""
::={ enterprises 2345 }
--- ::={ iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprises(1)
--- AODV-MIB(2345)} ?????????IMPORT enterprises
AODV OBJECT IDENTIFIER ::= { AODV-MIB 1 }
--the variables
TIMEOUT OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 1 }RREQ OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 2 }RREP OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 3 }RERR OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 4 }RBADPKTS OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 5 }
SREQ OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "" ::= { AODV 6 }
SREP OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 7 }SERR OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { AODV 8 }END
#########part of AODV.c####################
//debug start int test; //debug end
/*
* var_AODV():
* This function is called every time the agent gets a request for
* a scalar variable that might be found within your mib section
* registered above. It is up to you to do the right thing and
* return the correct value.
* You should also correct the value of "var_len" if necessary.
*
* Please see the documentation for more information about writing
* module extensions, and check out the examples in the examples
* and mibII directories.
*/
unsigned char *
var_AODV(struct variable *vp,
oid * name,
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
/*
* variables we may use later
*/
static long long_ret;
static u_long ulong_ret;
static unsigned char string[SPRINT_MAX_LEN];
static oid objid[MAX_OID_LEN];
static struct counter64 c64;
if (header_generic(vp, name, length, exact, var_len, write_method)
== MATCH_FAILED)
return NULL;/*
* this is where we do the value assignments for the mib results.
*/
switch (vp->magic) {
case RREP:
test = 444; /* XXX */
return (u_char *) & test;
case SREQ:
test = 444; /* XXX */
return (u_char *) & test;
case SREP:
test = 444; /* XXX */
return (u_char *) & test;
case RREQ:
test = 444; /* XXX */
return (u_char *) & test;
case RBADPKTS:
test = 444; /* XXX */
return (u_char *) & test;
case SERR:
test = 444; /* XXX */
return (u_char *) & test;
case TIMEOUT:
test = 444; /* XXX */
return (u_char *) & test;
case RERR:
test = 444; /* XXX */
return (u_char *) & test;
default:
ERROR_MSG("");
}
return NULL;
}
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
