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

Subha Velayutham vsubha at gmail.com
Sat Sep 24 01:37:04 CEST 2005


Hi Frank, I think I found the reason for memory corruption.

It is this line

unsigned long p1 =
((messagegate_mailout_mib_compThreadPoolActiveThreadCount*)r->get_nth(0))->get_state();

Is this a wrong way to get the current value of a column? I have made sure
that that row exists and I am obtaining the row using the find_index
function. If I remove this line, then everything works fine. SNMPWalk finds
the row properly.

However if I do this, it works fine:

unsigned long p1;
Vbx vbx= r->get_nth(0)->get_value();
int j= vbx.get_value(p1);

Is this is a better way? I want to get the current value in a row and update
(increment by a number or decrement by a number).

Thanks,
Subha

On 9/23/05, Frank Fock <fock at agentpp.com> wrote:
>
> Hi Subbha,
>
> When the number changes, then probably because of memory corruption.
> The column OID seems to be overwritten with arbitrary memory data.
> May be you can check your subagent with a memory checker?
>
> Best regards,
> Frank
>
> Subha Velayutham wrote:
>
> > Hi Frank,
> > I am not sure where this mysterious number is coming from. When I
> > run the subagent multiple times, I get different numbers there
> >
> > This is what I got one time: 13541346.
> >
> > 20050922.11:11:03: 2152: (3)DEBUG : SubAgentXMib: find next
> > (lower)(upper)(incl)(succ): (1.3.6.1.4.1.17617.1.1.4.1.2.1),
> > (1.3.6.1.4.1.17617.1.1.5), (FALSE),
> > (1.3.6.1.4.1.17617.1.1.4.1.2.1.13541346.6.87.111.114.107.101.114)
> >
> > What could I be doing wrong? This is the code that creates the row: Do
> > you find something wrong here?
> >
> > const Oidx& oid = Oidx::from_string("Worker");
> > std::string test(oid.as_string().get_printable());
> > std::cout << "oid of worker is " << test.c_str() << endl;
> > MibTableRow* r =
> > messagegate_mailout_mib_componentThreadPoolEntry::
> > instance->find_index(oid);
> > if(r == 0)
> > {
> > std::string test1(oid.as_string().get_printable());
> > std::cout << "oid of worker is " << test1.c_str() << endl;
> > MibTableRow* r =
> > messagegate_mailout_mib_componentThreadPoolEntry::
> > instance->add_row(oid);
> > std::string test2(oid.as_string().get_printable());
> > std::cout << "oid of worker is " << test2.c_str() << endl;
> > if(r!= 0)
> > {
> > int threadCount = 0;
> >
> >
> messagegate::AllSettings::getValue(WORKER_THREAD_COUNT_SETTING,threadCount);
> >
> >
> messagegate_mailout_mib_componentThreadPoolEntry::instance->set_row(r,0,threadCount);
> > }
> > }
> >
> > Thanks,
> > Subha
> >
> > On 9/22/05, *Frank Fock* <fock at agentpp.com <mailto:fock at agentpp.com>>
> > wrote:
> >
> > The following OID seems to be suspicious to me:
> >
> > 1.3.6.1.4.1.17617.1.1.4.1.2.1.13580320.6.87.111.114.107.101.114
> >
> > It looks like an OID from the table in question, but where comes the
> >
> > 13580320
> >
> > from when it only has an octet string as index?
> >
> > Best regards,
> > Frank
> >
> > Subha Velayutham wrote:
> >
> > > Here are the subagent's logs when the table is browsed by a manager
> > > application. I'll send the master agent logs in the next email.
> > > I used the following commands:
> > >
> > > SNMP4J.exe -a MD5 -A MD5UserAuthPassword -u MD5 -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>
> > > SNMP4J.exe -a MD5 -A MD5UserAuthPassword -u MD5 -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.17617.1.1.4"
> > > SNMP4J.exe -a MD5 -A MD5UserAuthPassword -u MD5 -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.17617.1.1.4.1.2.1 "
> > >
> > > Thanks,
> > > Subha
> > >
> > > On 9/22/05, *Frank Fock* <fock at agentpp.com
> > <mailto:fock at agentpp.com> <mailto:fock at agentpp.com
> > <mailto:fock at agentpp.com>>>
> > > wrote:
> > >
> > > Hi Subha,
> > >
> > > The logs do not indicate a duplicate registration, however it is
> > > strange that the subagent registers 1.3.6.1.4.1.17617
> > > and 1.3.6.1.4.1.17617.1.1.4 . This may lead to the problem.
> > > The identify it, we would need the logs when the table is
> > browser
> > > by a manager application.
> > >
> > > Best regards,
> > > Frank
> > >
> > >
> > > Subha Velayutham wrote:
> > >
> > > > Hi Frank, I have attached the subagent's logs. There is
> > only one
> > > > subagent. Wills end the master log in another email as it is
> > > exceeding
> > > > the mailing list size limit.
> > > >
> > > > If the OCTET STRING is used as index then is this how the
> > column
> > > oids
> > > > look:
> > > >
> > > > 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"
> > > >
> > > > Thanks,
> > > > Subha
> > > >
> > > >
> > > >
> > > >
> > > > On 9/20/05, *Frank Fock* < fock at agentpp.com
> > <mailto:fock at agentpp.com>
> > > <mailto:fock at agentpp.com <mailto:fock at agentpp.com>>
> > <mailto:fock at agentpp.com <mailto:fock at agentpp.com>
> > > <mailto: fock at agentpp.com <mailto:fock at agentpp.com>>> >
> > > > wrote:
> > > >
> > > > Hi Subbha,
> > > >
> > > > Using an OCTET STRING as index (or sub index) is
> > absolutely OK
> > > > and if the code has been generated by AgenPro, the index
> > > > definition etc.
> > > > should be OK too. May be you can send me the sub-agent log
> > > and the
> > > > master log when then subagent registers its MIB objects at
> > > the master?
> > > >
> > > > It could be a registration problem - probably because of
> > > overlapping
> > > > regions...
> > > >
> > > > Best regards,
> > > > Frank
> > > >
> > > > Subha Velayutham wrote:
> > > >
> > > >>Any answers to this, please?
> > > >>
> > > >>---------- Forwarded message ----------
> > > >>From: Subha Velayutham < vsubha at gmail.com
> > <mailto:vsubha at gmail.com>
> > > <mailto:vsubha at gmail.com <mailto:vsubha at gmail.com>> <mailto:
> > vsubha at gmail.com <mailto:vsubha at gmail.com>
> > > <mailto:vsubha at gmail.com <mailto: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
> > <mailto:fock at agentpp.com> <mailto:fock at agentpp.com
> > <mailto:fock at agentpp.com>>
> > > <mailto: fock at agentpp.com <mailto:fock at agentpp.com>
> > <mailto:fock at agentpp.com <mailto:fock at agentpp.com>>>>
> > > >>Cc: agentpp at agentpp.org <mailto:agentpp at agentpp.org>
> > <mailto: agentpp at agentpp.org <mailto:agentpp at agentpp.org>> <mailto:
> > > agentpp at agentpp.org <mailto:agentpp at agentpp.org>
> > <mailto:agentpp at agentpp.org <mailto: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
> > <mailto:fock at agentpp.com> <mailto: fock at agentpp.com
> > <mailto:fock at agentpp.com>>
> > > > <mailto: fock at agentpp.com <mailto:fock at agentpp.com>
> > <mailto:fock at agentpp.com <mailto: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
> > <mailto:fock at agentpp.com>
> > > <mailto:fock at agentpp.com <mailto:fock at agentpp.com>>
> > > > <mailto:fock at agentpp.com <mailto:fock at agentpp.com>
> > <mailto:fock at agentpp.com <mailto: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>
> > > > <http://127.0.0.1/4700 <http://127.0.0.1/4700>><
> > http://127.0.0.1/4700><
> > > >>>>>>
> > > >>>>>>
> > > >>>http://127.0.0.1/4700 <http://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>
> > > > <http://127.0.0.1/4700><http://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>
> > > > <http://127.0.0.1/4700 <http://127.0.0.1/4700>><
> > http://127.0.0.1/4700>
> > > >>>>>>
> > > >>>>>>
> > > >>><http://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 <mailto:AGENTPP at agentpp.org>
> > <mailto:AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>>
> > > <mailto:AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>
> > <mailto:AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>>>
> > > >>>>>> http://lists.agentpp.org/mailman/listinfo/agentpp
> > > <http://lists.agentpp.org/mailman/listinfo/agentpp>
> > > > < http://lists.agentpp.org/mailman/listinfo/agentpp>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>--
> > > >>>>>AGENT++
> > > >>>>> http://www.agentpp.com
> > > >>>>> http://www.mibexplorer.com
> > > >>>>> http://www.mibdesigner.com
> > <http://www.mibdesigner.com> <http://www.mibdesigner.com>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > >
> >
> >>>>------------------------------------------------------------------------
> > >
> > > >
> > > >>>>
> > > >>>>_______________________________________________
> > > >>>>AGENTPP mailing list
> > > >>>> AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>
> > <mailto: AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>> <mailto:
> > > AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>
> > <mailto:AGENTPP at agentpp.org <mailto: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 <mailto:AGENTPP at agentpp.org>
> > <mailto:AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>>
> > > <mailto: AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>
> > <mailto:AGENTPP at agentpp.org <mailto:AGENTPP at agentpp.org>>>
> > > >> http://lists.agentpp.org/mailman/listinfo/agentpp
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > AGENT++
> > > > http://www.agentpp.com
> > > > http://www.mibexplorer.com <http://www.mibexplorer.com>
> > > > http://www.mibdesigner.com
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > AGENT++
> > > http://www.agentpp.com
> > > http://www.mibexplorer.com
> > > http://www.mibdesigner.com
> > >
> > >
> > >
> >
> >
> > --
> > AGENT++
> > http://www.agentpp.com
> > http://www.mibexplorer.com
> > http://www.mibdesigner.com
> >
> >
> >
>
>
> --
> AGENT++
> http://www.agentpp.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
>
>
>



More information about the AGENTPP mailing list