CodeLab
9Aug/110

Memcached ZenPack version 1.2

After a long wait the version 1.2 of the ZenPacks.community.Memcached zenpack is ready (currently waiting for zenoss to process the github pull request).

3Mar/11Off

Python introspection: find which class defines each method

At $work we are currently developing a medium size framework where a common practice is having several levels of subclasses. Scripts written to exercise this framework can either use the subclasses for very specific functionality or restrict themselves to the top-level-class' methods only for maximum portability. But with several levels of inheritance, how do know in which class a method was defined? The solution that follows was a courtesy of Alex Martelli on the online forum stackoverflow:

Filed under: Python Continue reading
23Feb/11Off

Simple HTTP streaming with Twisted & Javascript

When writing web based apps a recurring problem is updating page contents in response to server side events. A classical pattern to solve it is to do periodic pooling of the server using XMLHttpRequests, however this often leads to making far more HTTP requests than what is really needed. It would be best to be able to originate the update from the server. Emerging technologies such as HTML5 websockets may provide a neat solution in the future, but until they become widely supported by all major browsers your path will be filled of all sort of "workarounds" to emulate the websockets on all those still catching-up. However a simple solution may be at hand in some particular cases: enter the world of html streaming.

19Aug/100

Writing a custom, non-SNMP, non-SSH, PythonPlugin-based zenoss modeler

If you have been customizing zenoss to suit your business needs you are likely to have developed several SNMP-based or SSH-based modelers in your zenpacks. But what if either protocol does not suit your needs? There is another, not so well documented plug-in class supported by zenoss: PythonPlugin.

24Jun/100

Accessing zenoss dmd from standalone scripts

Quite often is is very useful scripting repetitive tasks in zenoss, whether it might be listing devices and its properties, dumping lists of users, re-arranging organizers or other type of routine maintenance. To do so invariably you need to get hold of the zenoss dmd. This is a short snipped showing a way of doing it: