Feb 12, 2011 6:48 PM
Data points marked as 'missing' in Threshold
-
Like (0)
As per the title really!
I have created a zencommand data collector which uses the libinklevel library & ink utility to monitor the ink levels in my printer.
So I have 6 data points Black, Cyan, Magenta, Yellow, Photocyan, Photomagenta (or more correctly ink_Black etc)
These collect OK and plot on the graph OK
I create a threshold for low ink, add ALL the data points into the threshold, set minimum value of 11 etc
This works for a few iterations, but then stops monitoring all bar one data value (often the initial one added). If I go back into the threshold definition then all the datapoints bar one are shown as (missing) or sometimes (missing)(missing)(missing) etc
Looking at zencommand output I only see the one datapoint being checked against the threshold.although all are being retrieved and stored into RRD.
In the threshold definition if I remove / save / add / save one of the datapoints then that one is then monitored...
I could create 6 thresholds but that is just making work!
Is this a bug or am I doing it wrong?
David
edit
Zenoss 3.0.3 | |
OS | Linux (x86_64) 2.6.32 (Linux fitsserver 2.6.32-26-server #48-Ubuntu SMP Wed Nov 24 10:28:32 UTC 2010 x86_64) |
Zope | Zope 2.12.1 |
Python | Python 2.6.2 |
Database | MySQL 5.0.45 (Ver 5.0.45) |
RRD | RRDtool 1.3.9 |
Twisted | Twisted 8.1.0 |
NetSnmp | NetSnmp 5.4.1 |
PyNetSnmp | PyNetSnmp 0.28.14 |
WMI | Wmi 1.3.13 |
OK a little more information...
By looking in the Zope database I can see that all the datapoints (apart form the 1st) in the threshold definition seem to have had a space prepended to the names. If I manually delete this space then it is OK.
This seems to happen if I go into the threshold definition (via the normal gui route!) and then exit by clicking save rather than close/cancel.
Think this might qualify as a bug!
I'll have a quick dig around in the code...
David
Part way to a fix, I think the problem lies in the ThresholdClass in this function:
def getDataPointNamesString(self):"""Return a string that lists the datapoints used in this threshold.Indicate missing datapoints with (missing) after the name."""names = []availableDPNames = self.rrdTemplate.getRRDDataPointNames()for dsName in self.dsnames:if dsName in availableDPNames:names.append(dsName)else:names.append('%s(<span style="color: red">missing</span>)' % dsName)return ', '.join(names)
def add(self, threshold):self.byKey[threshold.key()] = thresholdd = self.byDevice.setdefault(threshold.context().deviceName, {})d[threshold.key()] = thresholdctx = threshold.context()for dp in threshold.dataPoints():## Need to clean up dp name - remove any HTML tags etc left from web gui ###self.byFilename.setdefault(ctx.fileKey(dp), []).append((threshold, dp))
# return ', '.join(names)
return ','.join(names)
So I shall see if I have broken anything else!
David
Moved to zen-dev as a bug....
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||