Thanks Dave.
Due to some restrictions, I can't change the version of agent to snmpV3.
So I opened another snmp_session, reading community strings from conf
file and issued a SNMP_GET. Its fetching the values ( in alarm
functions).
Now the problem is calling the same routine during a SET operation (of
an OID). I want to check whether the inputted OID exists or not. If I
call the same routine which was working before for the already existing
row, now is returning an error - "dropping bad AgentX request (wrong
mode 2)".
And the log file says " netsnmp_call_handlers() called illegally".
Am I doing something wrong here?
Thanks in advance,
Geo
The calling sequence is like this
a) SET_ACTION()
memcpy(row_ctx->myvar, var->val.objid,var->val_len);
row_ctx->myvar_len = var->val_len;
if ( ValidateOid( row_ctx->,myvar, row_ctx->myvar_len ) != TRUE )
{ /* return BAD_VALUE*/
b) ValidateOid(oid* pOid, size_t len ) /* my OID validation function*/
{
netsnmp_pdu *pdu = NULL, *response = NULL;
pdu = snmp_pdu_create( SNMP_MSG_GET );
snmp_add_null_var(pdu, pOid , len);
response = get_response( pdu );
}
c) get_response(netsnmp_pdu *pdu)
{
netsnmp_pdu *response;
int stat;
netsnmp_session *sess_handle = NULL;
netsnmp_session session;
snmp_sess_init(&session);
session.version = SNMP_VERSION_1;
session.community = (unsigned char*)my_community_str
session.community_len = strlen( session.community );
session.peername = "localhost";
sess_handle = snmp_open(&session);
stat = snmp_synch_response(sess_handle, pdu,&response); /*** PROBLEM
*/
}
-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 16, 2005 4:15 AM
To: George, Geo
Cc: [email protected]
Subject: RE: snmp_synch_response
On Wed, 2005-06-15 at 19:31, George, Geo wrote:
> Actually I am facing another problem with snmp_synch_response.
> Problem is Not able to do an internal Query for OID and get its
value.
> Response PDU always returns "NO_SUCH_NAME".
The access control code doesn't currently handle community-based
requests over the callback transport. Try with an SNMPv3 request.
Dave
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
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