Re: Having problem with stirng index table

geri noorzaman <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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 <[email protected]>
To: geri noorzaman <[email protected]>
Cc: [email protected]
Sent: Thursday, June 4, 2009 6:41:07 PM
Subject: Re: Having problem with stirng index table

2009/6/4 geri noorzaman <[email protected]>:
> 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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.