Wow,.1st of all Thank u for the fast reply,.
there's no problem with the integer index, and also I'm not missing the line:
vptr = vptr->next_variable;
What I posted earlier, it is just a piece of code, not complete code. The
problem is, when I try to query that table with snmpwalk, I get an output
something:
MIB::mibnodetableentry.1.'.ABCDE'.70.71.72 = INTEGER 21
My question is how to get an output something like:
MIB::mibnodetableentry.1.'ABCDEFGH' = INTEGER 21
I want to get all the string index in a complete format like:
.'ABCDEFGH'
and not like:
.'ABCDE'.70.71.72.
Why net-snmp outputting the query with format like that (half in string, half
in hex)???
Thank U so much.
________________________________
From: Dave Shield <d.t.shi...@liverpool.ac.uk>
To: geri noorzaman <noorzaman...@yahoo.com>
Cc: net-snmp-users@lists.sourceforge.net
Sent: Thursday, June 4, 2009 6:41:07 PM
Subject: Re: Having problem with stirng index table
2009/6/4 geri noorzaman <noorzaman...@yahoo.com>:
> and in the get_first_data_point and get_next_data_point, I set something
> like this:
>
> int idx=1;
That should probably be
long idx=1;
for safety.
> unsigned char idx2 [65535];
>
> snmp_set_var_value(vptr,(u_char *)&idx,sizeof(idx));
You seem to be missing
vptr = vptr->next_variable;
> strcpy(idx2,"ABCDEFGH");
> snmp_set_var_value(vptr,idx1,strlen(idx1));
Dave
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
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