TECHZEN Zenoss User Community ARCHIVE  

Calculated Performance ZenPack - using attributes and methods of components

Subject: Calculated Performance ZenPack - using attributes and methods of components
Author: Jane Curry
Posted: 2017-06-12 14:23

I want to use the Calculated Performance ZenPack to create datapoints for filesystem components.

A FileSystem object has attributes for blockSize and totalBlocks.  It has methods for usedBytes() and availBytes() (among others).

If I create a local copy of the FileSystem template for a specific filesystem on a specific device, in the CalculatedPerformance datasource dialogue, how do I refer to the blockSize attribute?  If I just use blockSize then, looking at a zenpython debug log, it is obviously looking for a datapoint called blockSize, not an attribute.  The README for the ZenPack definitely implies you can access component attributes.

Is it possible to access methods (rather than attributes) of components (and, indeed, devices)?

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


Subject: RE: Calculated Performance ZenPack - using attributes and methods of components
Author: Jane Curry
Posted: 2017-06-12 15:53

To answer my own question.....

Yes you can access a component attribute; the syntax is:
here.<attribute>           eg. here.blockSize

You can also access a method; for example a FileSystem has an availBytes() method.  To use it in a CalculatedPerformance datapoint, use:
here.availBytes                                 Note: No brackets, even though it is a method.

Once you have such datapoints, they can be used like any other in a threshold or graph.

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


< Previous
Use API to poll device / change device config
  Next
HOW the heck....Set/move to Location using API
>