Jul 29, 2013 7:17 AM
Help creating a custom daemon / collector
-
Like (0)
Hello!
I think I understand a part of the custom daemon creation process, reading through other ZenPacks and documentation on libraries used has proven useful. However, I do have a few questions, and it would be great if someone could help me find answers for them.
Lets say I'm creating a custom Daemon, so I have 4 python files, each with the classes in brackets:
- Daemonconfig.py (DaemonDataSourceConfig, DaemonConfig)
- DaemonDataSource.py (DaemonDataSource, IDaemonDataSourceInfo, DaemonDataSourceInfo, DaemonDataSourcePlugin)
- config.conf.py
- zenDaemon.py (DaemonPreferences, DaemonTask)
I believe these are all the classes I need to create a custom daemon. If I'm mistaken please let me know as that would be the first mistake!
In the DaemonDataSourcePlugin, what does the `collect(self, config)` method is meant to do?
I understand the rest of the `on...` methods are callbacks for the Deferred, but the actual `collect` is meant to return a Deferred. Where must I create this Deferred, and what must the Deferred be?
I don't really understand what the Deferred that is returned must do.
In the DaemonTask class, what does the `doTask(self)` method do?
It would seem like `collect()` has to return a Deferred (which I do not know where it comes from), and then `doTask()` runs the `collect()` and adds the callbacks to handle errors and successes.
Essentially the question is, where does the actual collection code go?
My collection code will query a STOMP server, and for each query get a result. Should each query be a Task, or should all of the collection be one Task?
If you need any more information please do not hesitate in asking.
Thank you for your time.
Best regards,
Jose
|
Follow Us On Twitter »
|
Latest from the Zenoss Blog » |
|
Community | Products | Services Resources | Customers Partners | About Us | |
|
|
|
Copyright © 2005-2011 Zenoss, Inc.
|
||||||
