Fwd: [AGENT++] How to get values put in a table?

Subha Velayutham vsubha at gmail.com
Tue Sep 20 02:15:42 CEST 2005


Any answers to this, please?

---------- Forwarded message ----------
From: Subha Velayutham <vsubha at gmail.com>
Date: Sep 14, 2005 5:42 PM
Subject: Re: [AGENT++] How to get values put in a table?
To: Frank Fock <fock at agentpp.com>
Cc: agentpp at agentpp.org

yes, the table is registered in the mib instance and the public community 
has read access to all the variables.

I kind of made progress on the issue a bit today. I was able to get the 
values using GET after some trial and error. But since our index is a string 
- the columns seem to be getting really long oids like this .. 
1.3.6.1.4.1.17617.1.1.4.1.2.1.2.06.87.111.114.107.101.114 - the part 
highlighted in yellow is the actual oid of the column ( here it is from the 
class 
#define oidCompThreadPoolActiveThreadCount "1.3.6.1.4.1.17617.1.1.4.1.2.1.2
")

The rest is all the representation of the string "Worker" in octet format. 
But snmpwalk is not able to get the values.

Is it not ok to have strings as Table index? If we use strings, am I using 
it in the correct way?

Thanks,
subha

On 9/14/05, Frank Fock <fock at agentpp.com> wrote:
> 
> Hi Subha,
> 
> Have you registered the table at your Mib instance? Does the "public"
> community has read access to all variables?
> 
> Best regards,
> Frank
> 
> Subha Velayutham wrote:
> 
> >Hi Frank, 
> >I am using snmpv2 community and the public community has read access. So 
> it
> >is not the access setting.
> >
> >In the attached file you can find the MIB definition for the table, the
> >class definition generated by AGenPro and the code that enters values 
> into 
> >the table.
> >
> >Thanks for looking into this. Expecting your reply. We really need to 
> find
> >out what we are doing wrong.
> >
> >Thanks,
> >Subha
> >
> >On 9/13/05, Frank Fock < fock at agentpp.com> wrote:
> >
> >
> >>Hi,
> >>
> >>Have you checked the view access settings?
> >>In order to be able to help further, we would need to know your 
> >>table and index MIB definition as well as the probably the
> >>table constructor and the code that adds the rows.
> >>
> >>Best regards,
> >>Frank
> >>
> >>
> >>Subha Velayutham wrote: 
> >>
> >>
> >>
> >>>Hi All! I have a Mibtable with 1 index and 2 columns. I can see that
> >>>
> >>>
> >>values
> >>
> >>
> >>>are being put into the table when I step through the sub agent code. 
> But 
> >>>
> >>>
> >>I
> >>
> >>
> >>>am not able to see the values when I do a snmpwalk or snmpget on the
> >>>
> >>>
> >>master
> >>
> >> 
> >>>agent - I amusing snmp4J console tool as my SNMP manager. snmpget when
> >>>queried with the column oid alone returns "noSuchObject" - column oid 
> +1
> >>>
> >>>
> >>or 
> >>
> >>
> >>>columnoid +2 returns "noSuchInstance" - GETBULK also doesnot seem to
> >>>
> >>>
> >>help. I
> >>
> >>
> >>>have enclosed the output here. Can someone tell me how exactly to get 
> my 
> >>>agent to return the table values?
> >>>
> >>>the xxx in the oid is where I put our company's private enterprise id.
> >>>
> >>>SNMP4J.exe -c public -v 2c -p GET 127.0.0.1/4700<http://127.0.0.1/4700><
> http://127.0.0.1/4700><
> >>>
> >>>
> >>http://127.0.0.1/4700> "
> >>
> >> 
> >>>1.3.6.1.4.1.xxx.1.1.4.1.2.1.2"
> >>>Received response after 30 millis
> >>>Response received with requestID=189239629, errorIndex=0,
> >>>errorStatus=Success(0)
> >>> 1.3.6.1.4.1.xxx.1.1.4.1.2.1.2 = noSuchObject
> >>>
> >>>SNMP4J.exe -c public -v 2c -p GET 127.0.0.1/4700<http://127.0.0.1/4700><
> http://127.0.0.1/4700 ><
> >>>
> >>>
> >>http://127.0.0.1/4700> "
> >>
> >>
> >>>1.3.6.1.4.1.xxx.1.1.4.1.2.1.2.1"
> >>>Received response after 30 millis 
> >>>Response received with requestID=758483289, errorIndex=0,
> >>>errorStatus=Success(0)
> >>>1.3.6.1.4.1.xxx.1.1.4.1.2.1.2.1 = noSuchInstance
> >>>
> >>>SNMP4J.exe -c public -v 2c -p GETBULK -Ow 127.0.0.1/4700<http://127.0.0.1/4700>
> <http://127.0.0.1/4700>
> >>>
> >>>
> >><http://127.0.0.1/4700>" 
> >>
> >>
> >>>1.3.6.1.4.1.xxx.1.1.4.1.2.1"
> >>>
> >>>Total requests sent: 1
> >>>Total objects received: 10
> >>>Total walk time: 30 milliseconds
> >>>End of walked subtree '1.3.6.1.4.1.xxx.1.1.4.1.2.1' reached at:
> >>>1.3.6.1.6.3.1.1.6.1.0 = 0
> >>>1.3.6.1.6.3.10.2.1.1.0 = 80:00:13:70:05:73:75:62:68:61:2d:6c:74:12:5c
> >>>1.3.6.1.6.3.10.2.1.2.0 = 21
> >>>1.3.6.1.6.3.10.2.1.3.0 = 880
> >>>1.3.6.1.6.3.10.2.1.4.0 = 4096
> >>>1.3.6.1.6.3.11.2.1.1.0 = 0
> >>>1.3.6.1.6.3.11.2.1.2.0 = 0
> >>>1.3.6.1.6.3.11.2.1.3.0 = 0
> >>>1.3.6.1.6.3.12.1.1.0 = 0
> >>>1.3.6.1.6.3.12.1.2.1.2.49.50.55.46.48.46.48.46.49.47.49.54.50 =
> >>>1.3.6.1.6.1.1
> >>>_______________________________________________
> >>>AGENTPP mailing list 
> >>>AGENTPP at agentpp.org
> >>>http://lists.agentpp.org/mailman/listinfo/agentpp
> >>> 
> >>>
> >>>
> >>>
> >>>
> >>>
> >>--
> >>AGENT++
> >>http://www.agentpp.com
> >> http://www.mibexplorer.com
> >>http://www.mibdesigner.com
> >>
> >>
> >>
> >>
> >>
> >
> >
> >------------------------------------------------------------------------ 
> >
> >_______________________________________________
> >AGENTPP mailing list
> >AGENTPP at agentpp.org
> > http://lists.agentpp.org/mailman/listinfo/agentpp
> >
> >
> 
> 
> --
> AGENT++
> http://www.agentpp.com
> http://www.mibexplorer.com 
> http://www.mibdesigner.com
> 
> 
>
-------------- next part --------------
componentThreadPoolTable OBJECT-TYPE
	SYNTAX  SEQUENCE OF ComponentThreadPoolEntry
	MAX-ACCESS not-accessible
	STATUS current
	DESCRIPTION
		"A table containing information about the component's thread usage."
	::= { commonStatistics 2 }


componentThreadPoolEntry OBJECT-TYPE
	SYNTAX  ComponentThreadPoolEntry
	MAX-ACCESS not-accessible
	STATUS current
	DESCRIPTION
		"An entry in the thread table for each thread pool."
	INDEX {
		compThreadPoolName }
	::= { componentThreadPoolTable 1 }


ComponentThreadPoolEntry ::= SEQUENCE {

	compThreadPoolName              DisplayString,
	compThreadPoolActiveThreadCount Unsigned32,
	compThreadPoolSize              Unsigned32 }


compThreadPoolName OBJECT-TYPE
	SYNTAX  DisplayString
	MAX-ACCESS not-accessible
	STATUS current
	DESCRIPTION
		"The name of the thread pool."
	::= { componentThreadPoolEntry 1 }


compThreadPoolActiveThreadCount OBJECT-TYPE
	SYNTAX  Unsigned32
	MAX-ACCESS read-only
	STATUS current
	DESCRIPTION
		"The current number of threads engaged in processing messages."
	::= { componentThreadPoolEntry 2 }


compThreadPoolSize OBJECT-TYPE
	SYNTAX  Unsigned32
	MAX-ACCESS read-only
	STATUS current
	DESCRIPTION
		"The maximum number of threads available for processing messages."
	::= { componentThreadPoolEntry 3 }


class componentThreadPoolEntry: public MibTable
{
public:
	componentThreadPoolEntry();
	virtual ~componentThreadPoolEntry();

	static componentThreadPoolEntry* instance;
	
	virtual void        	get_request(Request*, int);
	virtual int         	commit_set_request(Request*, int);
	virtual int         	prepare_set_request(Request*, int&);
	virtual void        	cleanup_set_request(Request*, int&);
	virtual int         	undo_set_request(Request*, int&);
	virtual void        	row_added(MibTableRow*, const Oidx&, MibTable*);
	virtual void        	row_delete(MibTableRow*, const Oidx&, MibTable*);
	virtual void        	row_init(MibTableRow*, const Oidx&, MibTable*);
	virtual void        	row_activated(MibTableRow*, const Oidx&, MibTable*);
	virtual void        	row_deactivated(MibTableRow*, const Oidx&, MibTable*);
	virtual void        	update(Request*);
	virtual int         	is_transition_ok(MibTable*, MibTableRow*, const Oidx&, int, int);
	virtual void		set_row(MibTableRow* r,
						        unsigned long p1,
						        unsigned long p2);
	virtual void		set_row(MibTableRow* r,
								unsigned long p1);
//--AgentGen BEGIN=componentThreadPoolEntry
//--AgentGen END
};

Code that adds values into the table is the following:

const Oidx& index = Oidx::from_string("Worker");
MibTableRow* r = componentThreadPoolEntry::instance->find_index(index);
if(r == 0)
{
	MibTableRow* r = componentThreadPoolEntry::
					instance->add_row(index);
	if(r!= 0)
	{
		int threadCount = 10; 
		componentThreadPoolEntry::instance->set_row(r,0,threadCount);
	}
}


More information about the AGENTPP mailing list