Skip to content

Commit

Permalink
show errors description by modeling, update only useful threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
epuzanov committed Oct 26, 2011
1 parent 0d6d828 commit a25f635
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ZenPacks/community/SQLDataSource/SQLPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
wrapper for PythonPlugin
$Id: SQLPlugin.py,v 2.4 2011/10/25 16:23:10 egor Exp $"""
$Id: SQLPlugin.py,v 2.5 2011/10/26 19:41:01 egor Exp $"""

__version__ = "$Revision: 2.4 $"[11:-2]
__version__ = "$Revision: 2.5 $"[11:-2]

from Products.DataCollector.plugins.CollectorPlugin import CollectorPlugin
from twisted.python.failure import Failure
Expand Down Expand Up @@ -44,8 +44,8 @@ def collect(self, device, log):
cl.close()
cl = None
return results
except:
log.error("Error opening sql client")
except Exception, ex:
log.error("Error: %s", ex)

def preprocess(self, results, log):
newres = {}
Expand Down
8 changes: 5 additions & 3 deletions ZenPacks/community/SQLDataSource/services/SqlPerfConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
Provides config to zenperfsql clients.
$Id: SqlPerfConfig.py,v 2.4 2011/10/25 16:28:35 egor Exp $"""
$Id: SqlPerfConfig.py,v 2.5 2011/10/26 20:26:18 egor Exp $"""

__version__ = "$Revision: 2.4 $"[11:-2]
__version__ = "$Revision: 2.5 $"[11:-2]

from Products.ZenCollector.services.config import CollectorConfigService
from Products.ZenUtils.ZenTales import talesEval
Expand Down Expand Up @@ -47,6 +47,7 @@ def _createDeviceProxy(self, device):
try: basepath = comp.rrdPath()
except: continue
for templ in comp.getRRDTemplates():
dpnames = []
for ds in templ.getRRDDataSources():
if not (isinstance(ds, DataSource) and ds.enabled):continue
sql, sqlp, kbs, cs = ds.getQueryInfo(comp)
Expand All @@ -56,6 +57,7 @@ def _createDeviceProxy(self, device):
columns = {}
for dp in ds.getRRDDataPoints():
dpname = dp.name()
dpnames.append(dpname)
alias = (dp.aliases() or [dp])[0]
aname = alias.id.strip().upper()
if hasattr(alias, 'formula'):
Expand All @@ -73,7 +75,7 @@ def _createDeviceProxy(self, device):
(dp.rrdmin, dp.rrdmax)))
queries[tn] = (sqlp, kbs, cs, columns, sql)

dpn = set(templ.getRRDDataPointNames())
dpn = set(dpnames)
for thr in templ.thresholds():
if not (thr.enabled and dpn & set(thr.dsnames)): continue
proxy.thresholds.append(thr.createThresholdInstance(comp))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.community.SQLDataSource"
VERSION = "1.98"
VERSION = "1.99"
AUTHOR = "Egor Puzanov"
LICENSE = ""
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.community']
Expand Down

0 comments on commit a25f635

Please sign in to comment.