Hi,
the resolve() function expects a string. You don't even need to import the monitoring stuff.

inst.Monitoring = ctxt.resolve("nox.netapps.monitoring.monitoring.Monitoring")

Of course you should ensure that the Monitoring module is resolvable, that means, it must be loaded by NOX either by issueing it on the commandline or (which is the cleaner way) it must be declared in the meta.json file of your component as a dependency.

Hope that helps.

Best regards,
Bernd


On 27.02.2012 17:53, Baraki Halefom wrote:

Hello everyone,

I want use the methods in the Monitoring component to send flow stats request from my own component.
I did the following two variations to user the monitoring component

1. include monitoring component in the dependency list of my components meta.json file

import the monitoring component as: from nox.netapps.monitoring.monitoring import Monitoring

        then inside my component :

          def __init_(self, ctxt):
              global inst
              Component.__init__(self,ctxt)
              inst.Monitoring = ctxt.resolve(Monitoring)

and then use it like,  inst.Monitoring.send_flow_
stats_request(....)

 this gives me Monitoring description not found error.

2. when I tried to use the monitoring component in the command line after the proper import as follows

> ./nox_core -i ptcp:6633 monitoring mycomponent

it gives me again the following error.
            inst.Monitoring = ctxt.resolve(Monitoring)
AttributeError: 'NoneType' object has not attribute 'Monitoring'

please tell me where my mistake is.

thanks

--


Baraki H. Abay
Department of Math and Computer science
North Carolina Central University
Durham, 27707 NC



_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to