0

I have implemented AgentX using mib2c.create-dataset.conf ( with cache enabled) In my snmd.conf :: agentXTimeout 15

In testtable.h file I have changed cache value as below...

#define testTABLE_TIMEOUT        60

According to my understanding It loads data every 60 second. Now my issue is if the data in data table is exceeds some amount it takes some amount of time to load it.

As in between If I fired SNMPWALK it gives me “no response from the host” If I use SNMPWALK for whole table and in between testTABLE_TIMEOUT occurs it stops in between and shows following error (no response from the host). Please tell me how to solve it ? In my table large amount of data is present and changing frequently.

I read some where: (when the agent receives a request for something in this table and the cache is older than the defined timeout (12s > 10s), then it does re-load the data. This is the expected behaviour. However the agent does not automatically release the local cache (i.e. call the 'free' routine) as soon as the timeout has expired. Instead this is handled by a regular "garbage collection" run (once a minute), which will free any stale caches. In the meantime, a request that tries to use that cache will spot that it's expired, and reload the data.)

Is there any connection between these two ?? I can’t get this... How to resolve my problem ???

jatin bodarya
  • 72
  • 3
  • 8

1 Answers1

0

Unfortunately, if your data set is very large and it takes a long time to load then you simply need to suffer the slow load and slow response. You can try and load the data on a regular basis using snmp_alarm or something so it's immediately available when a request comes in, but that doesn't really solve the problem either since the request could still come right after the alarm is triggered and the agent will still take a long time to respond.

So... the best thing to do is optimize your load routine as much as possible, and possibly simply increase the timeout that the manager uses. For snmpwalk, for example, you might add -t 30 to the command line arguments and I bet everything will suddenly work just fine.

Wes Hardaker
  • 21,735
  • 2
  • 38
  • 69
  • I don't have have any problem with slow load and slow response..my issue is I suppose to do snmpwalk after every frequent time... ( eg. after every 60 second) on whole data... so can I just prevent from "no response from the host" with any method, If It will give me old data and by the next call of snmpwalk it get updated, that is also acceptable. As with timeout 60 , It takes 10 second to get update the cache !!! so In between It returns no response, is it possible that It returns old data at that time,and with the next call returns the data from cache... while it is not updating !!! – jatin bodarya Oct 31 '12 at 14:03
  • If it takes 10 seconds to update the cache, I'd argue that's what you need to fix. Or, if you can look up the data yourself in your data in less time given the MIB index in question, then the fastest thing to do is write your own handler rather than use one of the data caching ones. But... it's harder and you have to know more. – Wes Hardaker Oct 31 '12 at 14:07
  • okey,It is acceptable, but if the data is large it some times gives following errors in between: Error in packet.Reason:(genError) A general failure occured Faild object:XXX::yyy.2012 . can you help me with this ? and becaus of this Subagent itself stops !!! – jatin bodarya Oct 31 '12 at 14:16
  • You'll need a debugger to figure out the genError case. Generally that shouldn't be happening, though, so something is strange – Wes Hardaker Oct 31 '12 at 15:44
  • can I split it with two separate codes ? means one code returns value form oid ...1.1 to ...1.1000 then 2nd code return table value from ...1.1001 to ...1.2000 ? like wise ? so I suppose to add only 1000 rows in a column and than next in 2nd file..which can be read by 2nd program....? – jatin bodarya Nov 01 '12 at 08:57
  • You can, yes, but you'll need to write a handler function directly that can tell when you need to do the second load. The existing helping functions aren't smart enough to do partial-cache loading. But it is possible to write your own. – Wes Hardaker Nov 01 '12 at 13:21
  • The one thing that people have problems with in SNMP is that at some point, their desire to add really cool thing or huge data sets outgrows their basic understanding of SNMP and the net-snmp agent. You can do amazing things, once you understand how everything works fully. I once consulted for a company that had a very slow agent and rewrote huge parts of their code and achieved a 1000x increase in performance for some tables. But I was an expert, and the people that wrote the original code were not. I taught them a lot and they should be ok in the future. – Wes Hardaker Nov 01 '12 at 13:23