1
2
3
4
5
6
7
8
9
10
11
12
13
14 from AccessControl import ClassSecurityInfo
15
16 import Globals
17 from Products.ZenModel.ZenModelRM import ZenModelRM
18 from Products.ZenModel.ZenPackable import ZenPackable
19 from Products.ZenRelations.RelSchema import *
20
22
24 """A ThresholdClass is a threshold description stored in a
25 Template. The ThresholdClass will create ThresholdInstance
26 objects when provided with a context, such as a device. Lists of
27 ThresholdInstances will be sent to collectors for evaluation.
28 """
29
30 meta_type = 'ThresholdClass'
31 security = ClassSecurityInfo()
32 dsnames = []
33 enabled = True
34
39
40 _properties = (
41 {'id':'dsnames', 'type':'lines', 'mode':'w'},
42 {'id':'enabled', 'type':'boolean', 'mode':'w'},
43 )
44
45 _relations = ZenPackable._relations + (
46 ("rrdTemplate", ToOne(ToManyCont,"Products.ZenModel.RRDTemplate", "thresholds")),
47 )
48
51
52
60
61
63 """Return a sub-class of ThresholdInstance. May raise a
64 BadInstance exception if the type of the context does not
65 match this type of threshold.
66 """
67
68
70 """Returns true if instances of this ThresholdClass can be
71 placed on a users' graph"""
72 return True
73
74
75 - def sync(self, eventManager, instances):
76 "update instances with state from the event manager"
77
78
81