Hello Coders,
I generated C language codes by using "mib2c CCbsInfoTable", w/t 2-Net-SNMP
sytle, 2-"list of rows is held by the agent itself", and 5-Net-SNMP container
MFD.
Our private MIBs looks like
-----------------------------------------
sndaSnmpMIB MODULE-IDENTITY
...
::= { ucdExperimental 5243 }
sndaServices OBJECT IDENTIFIER ::= { sndaSnmpMIB 1 }
cbsHost OBJECT IDENTIFIER ::= { sndaServices 1 }
--
-- CCbsInfo implementations
--
CCbsInfoEntry ::= SEQUENCE{
Ip4CbsInfo IpAddress,
...
}
CCbsInfoTable OBJECT-TYPE
SYNTAX SEQUENCE OF CCbsInfoEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"the cbsInfo object table"
::= {cbsHost 1}
CCbsInfoRow OBJECT-TYPE
SYNTAX CCbsInfoEntry
MAX-ACCESS not-accessible
STATUS current
INDEX {Ip4CbsInfo,
Port4CbsInfo}
::= {CCbsInfoTable 1}
Ip4CbsInfo OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"IP Address of the service"
::= {CCbsInfoRow 1}
----------------------------------------------------------
We implemented SNMP GET related codes (I gave the name GET-handler) in
int CCbsInfoTable_container_load(netsnmp_container * container) of file
CCbsInfoTable_data_access.c which mib2c generated.
So the subagent will work fine if SNMP client send
snmpwalk ... cbsHost
GET request.
You know that my IpAddress will be inserted into MIB by such codes:
--------------------------------------------
int CCbsInfoTable_container_load(netsnmp_container * container)
{
...
if (MFD_SUCCESS !=
/*rex CCbsInfoTable_indexes_set(rowreq_ctx, Ip4CbsInfo,
Port4CbsInfo)) { */
CCbsInfoTable_indexes_set(rowreq_ctx, ps->ip,
ps->port)) {
snmp_log(LOG_ERR,
"error setting index while loading "
"CCbsInfoTable data.\n");
CCbsInfoTable_release_rowreq_ctx(rowreq_ctx);
continue;
}
...
}
--------------------------------------------------
As I saw that the SNMP client will get correct Ip4CbsInfo value which I gave.
I doubt that where I should write codes (I gave the name SET-handler) to in
those CCbsInfoTable_xxx.c files if handle SNMP client's
snmpset -v 2c -c private .... ...::Ip4CbsInfo x <IpAddressHexCode>
SET request?
How to get Ip4CbsInfo's value which SNMP client set?
Will codes
--------------------------------------
int CCbsInfoTable_container_load(netsnmp_container * container)
{
...
u_int32_t MyIp=rowreq_ctx->data.Ip4CbsInfo;
...
}
--------------------------------------
work?
There is no code in file CCbsInfoTable_data_set.c.
There is
-----------------------------
/***********************************************************************
*
* SET processing
*
***********************************************************************/
/*
* SET PROCESSING NOT APPLICABLE (per MIB or user setting)
*/
------------------------------
in CCbsInfoTable_interface.c, does it mean that no SET-handler could be used?
How can I get MIB-value in sub-agent? The MIB-value will be set by using
snmpset.
Please give me the hints.
Thanks!
Regards,
Rex Huang
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders