RE: array_user.conf row creation

This is a discussion on RE: array_user.conf row creation within the SNMP Users forums, part of the Networking and Network Related category; Thanks Robert. Actually that problem is resolved. I was not allocating memory properly. -----Original Message----- From: George, Geo=20 Sent: ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-23-2005
George, Geo
 
Posts: n/a
Default RE: array_user.conf row creation

Thanks Robert.
Actually that problem is resolved. I was not allocating memory properly.

-----Original Message-----
From: George, Geo=20
Sent: Friday, April 22, 2005 4:09 PM
To: 'net-snmp-users@lists.sourceforge.net'
Subject: RE: array_user.conf row creation

Thanks Robert.
I have implemented my Sample MIB and its up and running now.
The problem is when I query the Table its giving "Error in Packet", "No
such Name in this MIB. I though it's the problem with index and tried
with some changes there, but it dint help.

When I am querying the agent, proper index is appended which I used for
creating the table row. Also I am suspecting my register function
whether it is successful or not. (netsnmp_table_container_register is
returning 0).

Snippet from my code is attached below.

Creation of row <<start>>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
netsnmp_index index;
xxxTable_context *context;
oid tmp_oid[256];

initialize_table_xxxTable();

/* set temp oid for new row */
tmp_oid[ 0 ] =3D 1;

/* set temp index */
index.oids =3D tmp_oid;
index.len =3D 1;

/* create row */

context =3D cpqHoFileSysTable_create_row(&index);
context->val1 =3D 100;

Creation of row <<END>>

Waiting for you reply...
Regards,
Geo


-----Original Message-----
From: Robert Story [mailto:rstory@freesnmp.com]=20
Sent: Friday, April 22, 2005 10:21 AM
To: George, Geo
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: array_user.conf row creation

On Fri, 22 Apr 2005 08:06:16 -0700 George, wrote:
GG> Can you please provide some information regarding addition of
caching to
GG> this?

There are two ways to do this. One is to completely flush the cache each
time,
and reload it from scratch. The other is to search the cache for exiting
rows
to update/add/remove.

The first is fairly simple. use CONTAINER_FOR_EACH to go through and
free each
row, then CONTAINER_CLEAR, followed by inserting all rows again.

The second is a little more complicated, but required if you want to
keep some
non-cache data in the row. For an example, see the ifTable cache_load in

mibgroup/if-mib/ifTable/ifTable_data_access.c.

GG> 1) The question is can I directly add snmp_alarm_register? After
GG> Initialization Something like the below statement which basically
GG> reloads data?
GG>=20
GG> snmp_alarm_register(timeout, SA_REPEAT, Reload, NULL);

yep, that would work.

GG> 2) If I add my own refresh routines, how to handle the requests
while
GG> reloading the data?

Since the agent is single threaded, and alarms don't run while requests
are
being processed, it shouldn't be an issue.

--=20
NOTE: messages sent directly to me, instead of the lists, will be
deleted
unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> =20
Archive:
<http://sourceforge.net/mailarchive/forum.php?forum=3Dnet-snmp-users>

You are lost in a twisty maze of little standards, all different.=20


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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/...net-snmp-users
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0