Commit e57e47e Daniel Rossbach
committed
1 parent 60096a8 commit e57e47e Copy full SHA for e57e47e
File tree 4 files changed +17
-0
lines changed
4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ def create
32
32
self . interval = resource [ :interval ]
33
33
self . subscribers = resource [ :subscribers ]
34
34
# Optional arguments
35
+ self . sla = resource [ :sla ] unless resource [ :sla ] . nil?
35
36
self . type = resource [ :type ] unless resource [ :type ] . nil?
36
37
self . config = resource [ :config ] unless resource [ :config ] . nil?
37
38
self . aggregate = resource [ :aggregate ] unless resource [ :aggregate ] . nil?
@@ -105,6 +106,14 @@ def subscribers=(value)
105
106
conf [ 'checks' ] [ resource [ :name ] ] [ 'subscribers' ] = value
106
107
end
107
108
109
+ def sla
110
+ conf [ 'checks' ] [ resource [ :name ] ] [ 'sla' ] || [ ]
111
+ end
112
+
113
+ def sla = ( value )
114
+ conf [ 'checks' ] [ resource [ :name ] ] [ 'sla' ] = value
115
+ end
116
+
108
117
def type
109
118
conf [ 'checks' ] [ resource [ :name ] ] [ 'type' ]
110
119
end
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ def initialize(*args)
67
67
desc "Who is subscribed to this check"
68
68
end
69
69
70
+ newproperty ( :sla , :array_matching => :all ) do
71
+ desc "custom variable for notifu"
72
+ end
73
+
70
74
newproperty ( :type ) do
71
75
desc "What type of check is this"
72
76
end
Original file line number Diff line number Diff line change 13
13
$standalone = undef ,
14
14
$interval = ' 60' ,
15
15
$subscribers = [],
16
+ $sla = [],
16
17
$notification = undef ,
17
18
$low_flap_threshold = undef ,
18
19
$high_flap_threshold = undef ,
34
35
handlers => $handlers ,
35
36
interval => $interval ,
36
37
subscribers => $subscribers ,
38
+ sla => $sla ,
37
39
notification => $notification ,
38
40
low_flap_threshold => $low_flap_threshold ,
39
41
high_flap_threshold => $high_flap_threshold ,
Original file line number Diff line number Diff line change 21
21
:handlers => [ '/handler1' , '/handler2' ] ,
22
22
:interval => '10' ,
23
23
:subscribers => [ 'all' ] ,
24
+ :sla => [ 'admin:2' ] ,
24
25
:type => 'metric' ,
25
26
:standalone => true ,
26
27
:notification => 'some text' ,
35
36
'handlers' => [ '/handler1' , '/handler2' ] ,
36
37
'interval' => '10' ,
37
38
'subscribers' => [ 'all' ] ,
39
+ 'sla' => [ 'admin:2' ] ,
38
40
'type' => 'metric' ,
39
41
'standalone' => true ,
40
42
'notification' => 'some text' ,
You can’t perform that action at this time.
0 commit comments