Re: [nox-dev] monitoring usage error
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
Re: [nox-dev] monitoring usage error
Hi, it complains about inst not being declared (it is of type None). You missed the inst = self in the __init__ method of your component. Maybe you should take a look at the pyswitch.py from coreapps/examples. Best regards Bernd On 28.02.2012 14:59, Baraki Halefom wrote: Thank you for your reply. but I got same same error AttributeError: 'NoneType' object has no attribute 'Monitoring' after making the changes you told me. inst.Monitoring = ctxt.resolve(nox.netapps.monitoring.monitoring.Monitoring) and run monitoring in the commandline Sincerely, On Tue, Feb 28, 2012 at 7:28 AM, Bernd Wittefeld s9bew...@stud.uni-saarland.de mailto:s9bew...@stud.uni-saarland.de wrote: 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 tel:27.02.2012%2017: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 mailto:nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev -- 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] monitoring usage error
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 monitoringcomponent 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