access of table elements

Gavin Simpson gsimpson____argogroup.com
Thu Apr 19 16:33:02 CEST 2001


Frank,

thanks for your previous reply.

We have managed to compile and run the example cmd_exe.my agent but this
doesn't create any rows within the tables. Having looked through the
faqs and mailing list we have come up with the following ( by adding in
add_row and set_row ) but we are still getting "noSuchName" returned
from the agent. 

Could someone please supply us with a working example of an agent that
contains a table which has at least one row containing data, as we
cannot figure out how to do this.

Thanks in advance,
Gav and Paul.


cmdExecutionCmdConfigEntry::cmdExecutionCmdConfigEntry():
   MibTable(oidCmdExecutionCmdConfigEntry,
indCmdExecutionCmdConfigEntry, 1)
{
	// This table object is a singleton. In order to access it use
	// the static pointer cmdExecutionCmdConfigEntry::instance.
	instance = this;

	add_col(new
cmdExecutionCmdConfigLine(colCmdExecutionCmdConfigLine));
	add_col(new
cmdExecutionCmdConfigStorage(colCmdExecutionCmdConfigStorage));
	add_col(new
cmdExecutionCmdConfigRowStatus(colCmdExecutionCmdConfigRowStatus));

	//--AgentGen
BEGIN=cmdExecutionCmdConfigEntry::cmdExecutionCmdConfigEntry

      //////////////////////////////////////////////////
      // We've added the following ......
      //////////////////////////////////////////////////
      Oidx ind("0");                              
      if (!is_index_valid(ind)) printf("####tERROR####\n");
      MibTableRow* r = add_row(ind);
      set_row(r, "", 0,0);

      r = add_row("1");
      set_row(r, "", 0,0);
      //--AgentGen END
}

-----Original Message-----
From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
Sent: 19 April 2001 10:36
To: Gavin Simpson
Cc: agentpp-dl____agentpp.com
Subject: Re: access of table elements


Hi Gavin,

Please use the MIB from the 
http://www.agentpp.com/COMMAND-EXECUTION-MIB.txt

The MIB in the AGENT++ distribution file is out of date.
I will update it in the next release.

The problem seems to be that there are no leaf objects
in that MIB. All objects are part of a table. So you
will not be able to access any object under
1.3.6.1.4.1.4976.6.1.2.3.1.1.2.0
unless an output line 0 exists.

Hope this helps.

Regards,
Frank

>
> Hi,
> 
> I've taken the example cmd_exe.my and compiled it using agentgen to
> produce the source code ( for this to work I had to add an 
OBJECT-GROUP
> ).
> I've then compiled the resultant code with the example agent.cpp 
given
> to produce the agent.
> 
> When I try to access any of the leaves within any table contained 
within
> my agent using either Loriot or Openview I get "noSuchName" returned 
but
> the OID seems OK.
> 
> This is the OID as defined in the header file:
> #define oidCmdExecutionOutputLine
> "1.3.6.1.4.1.4976.6.1.2.3.1.1.2"
> 
> This is the response to a GET_REQ_MSG:
> 
> PDU:
> ----
> version:      0
> community:    public
> type:         GET_RSP_MSG (0xa2)
> request id:   8
> error status: noSuchName(2)
> error index:  1
> --------------------------------------------------
> name:    1.3.6.1.4.1.4976.6.1.2.3.1.1.2.0
> type:    NULL (0x5)
> length:  0
> value:    ( )
> --------------------------------------------------
> 
> 
> I feel I'm doing something fundamentally wrong, can someone help?
> 
> Regards,
> Gavin Simpson. 
> 
> 
> p.s. agent running on a Solaris box through the Solaris snmp master
> agent.
> 
> 
> 
> 
> 




More information about the AGENTPP mailing list