[AGENT++] Adding rows to MibTable?!?&In-Reply-To=1087991609023437 at lycos-europe.com

Jacek Marynowski j.maryno at lycos.de
Thu Jun 24 16:07:14 CEST 2004


Hi Frank,
Ja, that helps.
But let me tell about another problem.
I modified the update method from the dynamic_table example in the following fashion:
virtual void update(Request* req) 
{
  if (currentRequest == req->get_request_id()) return;
  currentRequest = req->get_request_id();

  start_synch();
  
  for (int i=0; i<16; ++i)
  {
        MibTableRow* row = add_row(get_next_avail_index());
        row->get_nth(0)->replace_value(new SnmpInt32(i));

 }
}

Result from my NMS is an endless loop that endlessly adds rows filling them from 0 to 15.
Something like this:
SNMPv2-SMI::enterprises.4976.6.2.1.1.1 = INTEGER: 0
SNMPv2-SMI::enterprises.4976.6.2.1.1.2 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.6.2.1.1.3 = INTEGER: 2
SNMPv2-SMI::enterprises.4976.6.2.1.1.4 = INTEGER: 3
SNMPv2-SMI::enterprises.4976.6.2.1.1.5 = INTEGER: 4
SNMPv2-SMI::enterprises.4976.6.2.1.1.6 = INTEGER: 5
SNMPv2-SMI::enterprises.4976.6.2.1.1.7 = INTEGER: 6
SNMPv2-SMI::enterprises.4976.6.2.1.1.8 = INTEGER: 7
SNMPv2-SMI::enterprises.4976.6.2.1.1.9 = INTEGER: 8
SNMPv2-SMI::enterprises.4976.6.2.1.1.10 = INTEGER: 9
SNMPv2-SMI::enterprises.4976.6.2.1.1.11 = INTEGER: 10
SNMPv2-SMI::enterprises.4976.6.2.1.1.12 = INTEGER: 11
SNMPv2-SMI::enterprises.4976.6.2.1.1.13 = INTEGER: 12
SNMPv2-SMI::enterprises.4976.6.2.1.1.14 = INTEGER: 13
SNMPv2-SMI::enterprises.4976.6.2.1.1.15 = INTEGER: 14
SNMPv2-SMI::enterprises.4976.6.2.1.1.16 = INTEGER: 15
SNMPv2-SMI::enterprises.4976.6.2.1.1.17 = INTEGER: 0
SNMPv2-SMI::enterprises.4976.6.2.1.1.18 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.6.2.1.1.19 = INTEGER: 2
SNMPv2-SMI::enterprises.4976.6.2.1.1.20 = INTEGER: 3
SNMPv2-SMI::enterprises.4976.6.2.1.1.21 = INTEGER: 4
SNMPv2-SMI::enterprises.4976.6.2.1.1.22 = INTEGER: 5
SNMPv2-SMI::enterprises.4976.6.2.1.1.23 = INTEGER: 6
SNMPv2-SMI::enterprises.4976.6.2.1.1.24 = INTEGER: 7
SNMPv2-SMI::enterprises.4976.6.2.1.1.25 = INTEGER: 8
SNMPv2-SMI::enterprises.4976.6.2.1.1.26 = INTEGER: 9
SNMPv2-SMI::enterprises.4976.6.2.1.1.27 = INTEGER: 10
SNMPv2-SMI::enterprises.4976.6.2.1.1.28 = INTEGER: 11
SNMPv2-SMI::enterprises.4976.6.2.1.1.29 = INTEGER: 12
SNMPv2-SMI::enterprises.4976.6.2.1.1.30 = INTEGER: 13
SNMPv2-SMI::enterprises.4976.6.2.1.1.31 = INTEGER: 14
SNMPv2-SMI::enterprises.4976.6.2.1.1.32 = INTEGER: 15

and so on......

This can't be intended, can it?

JaceK Marynoski



Hi Jaceck,

I would recommend using the MibTable::update method to update your table
as shown by the dynamic_table example.  The update method (which is empty
in MibTable and needs to be overwritten by subclasses that want to use it)
is called by the AGENT++ framework automatically.

There are several threads on this topic in the mailing list archive as well,
if you need furhter information.

Hope this helps.

Best regards,
Frank

Jacek Marynowski wrote:

>First post here.
>So hello to you all.
>I've been working with agent++, agentx++ and snmp++ api for two month now and with the available
>online documentation plus the included examples, everything seems to be quite simple for the development
>of our snmp capable agent.
>But there's one thing I cannot clearly comprehend. The implementation of tables and furthermore adding new 
>rows to the table.
>Let me tell you about my problem, so it will be hopefully more clear.
>Our snmp agent is supposed to monitor processes in ram. Agent should also be able to kill one or more 
processes 
>if desired. The written mib file (digest) looks like this:
>
>processTable OBJECT-TYPE
>   SYNTAX                 SEQUENCE OF ProcessEntry
>   MAX-ACCESS         not-accessible
>   STATUS                  current
>   DESCRIPTION       ""
>   ::= {ramObjects 1}
>
>processEntry OBJECT-TYPE
>   SYNTAX                 ProcessEntry
>   MAX-ACCESS         not-accessible
>   STATUS                  current
>   DESCRIPTION       ""
>   ::= {processTable 1}
>
>ProcessEntry ::= SEQUENCE
>{
>   processID                    Unsigned32,
>   user                             DisplayString,
>   memUtilisation            DisplayString,
>   processStatus             RowStatus,
>}
>
>The object definitions for processID, user, memUtilisation and processStatus are as expected so I don't figure 
>them out here.
>
>OK. Whenever a network management console polls the complete processTable, the agent shall perform a ram 
>query and add the received values as rows into the mib table (processTable). And if the console polls
>the same request (a few hours) later, then agent shall delete the old rows from processTable and perform 
>a new ram query to fill the table again.
>And this is what I do not comprehend to accomplish.
>Can this actually done with agentpp api's?
>I've got some code construct for the above written mib file generated by agentgen. I've also taken a look into 
>the implementations of snmp_target_mib and v3_mib as this was a hint to a table related question a few 
threads 
>earlier.
>Nevertheless I just do not know where to start implementing that kind of mib instrumentation.
>I hope I could make my problem clear to you.
>
>Any kind of help will be appreciated
>Jacek Marynowski
>
>__________________________________________________________________
>Stiftung Warentest vergibt Note "gut" für Lycos Mail!
>Top SPAM- und Virenschutz, 15MB Megaspeicher und SMS schon ab 5 Cent!  
 Noch Fragen? http://mail.lycos.de
>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://agentpp.org/mailman/listinfo/agentpp
>  
>

__________________________________________________________________
Stiftung Warentest vergibt Note "gut" für Lycos Mail!
Top SPAM- und Virenschutz, 15MB Megaspeicher und SMS schon ab 5 Cent!  <br> Noch Fragen? http://mail.lycos.de




More information about the AGENTPP mailing list