|
1 | 1 | # Server-side metrics settings for plugin for monitoring Kubernetes namespaces, |
2 | 2 | # ©2024 henri.wahl@ukdd.de |
3 | 3 |
|
4 | | -from cmk.graphing.v1 import Title, Color, graphs, metrics |
| 4 | +from cmk.graphing.v1 import Title, graphs, metrics |
5 | 5 |
|
6 | 6 | # --- PersistentVolumes --- |
7 | 7 |
|
8 | 8 | metric_persistent_volume_used = metrics.Metric( |
9 | 9 | name='persistent_volume_used', |
10 | 10 | title=Title('Persistent Volume Used'), |
11 | 11 | unit=metrics.Unit(metrics.DecimalNotation("B")), |
12 | | - color=Color.DARK_RED, |
| 12 | + color=metrics.Color.DARK_RED, |
13 | 13 | ) |
14 | 14 |
|
15 | 15 | metric_persistent_volume_capacity = metrics.Metric( |
16 | 16 | name='persistent_volume_capacity', |
17 | 17 | title=Title('Persistent Volume Capacity'), |
18 | 18 | unit=metrics.Unit(metrics.DecimalNotation("B")), |
19 | | - color=Color.DARK_GREEN, |
| 19 | + color=metrics.Color.DARK_GREEN, |
20 | 20 | ) |
21 | 21 |
|
22 | 22 | metric_persistent_volume_percentage = metrics.Metric( |
23 | 23 | name='persistent_volume_percentage', |
24 | 24 | title=Title('Persistent Volume Percentage'), |
25 | 25 | unit=metrics.Unit(metrics.DecimalNotation("%")), |
26 | | - color=Color.DARK_BLUE, |
| 26 | + color=metrics.Color.DARK_BLUE, |
27 | 27 | ) |
28 | 28 |
|
29 | 29 | graph_persistent_volumes = graphs.Graph( |
|
41 | 41 | name='pods_running', |
42 | 42 | title=Title('Pods Running'), |
43 | 43 | unit=metrics.Unit(metrics.DecimalNotation("")), |
44 | | - color=Color.GREEN, |
| 44 | + color=metrics.Color.GREEN, |
45 | 45 | ) |
46 | 46 |
|
47 | 47 | metric_pods_waiting = metrics.Metric( |
48 | 48 | name='pods_waiting', |
49 | 49 | title=Title('Pods Waiting'), |
50 | 50 | unit=metrics.Unit(metrics.DecimalNotation("")), |
51 | | - color=Color.YELLOW, |
| 51 | + color=metrics.Color.YELLOW, |
52 | 52 | ) |
53 | 53 |
|
54 | 54 | metric_pods_terminated = metrics.Metric( |
55 | 55 | name='pods_terminated', |
56 | 56 | title=Title('Pods Terminated'), |
57 | 57 | unit=metrics.Unit(metrics.DecimalNotation("")), |
58 | | - color=Color.GRAY, |
| 58 | + color=metrics.Color.GRAY, |
59 | 59 | ) |
60 | 60 |
|
61 | 61 | metric_pods_crashing = metrics.Metric( |
62 | 62 | name='pods_crashing', |
63 | 63 | title=Title('Pods Crashing'), |
64 | 64 | unit=metrics.Unit(metrics.DecimalNotation("")), |
65 | | - color=Color.RED, |
| 65 | + color=metrics.Color.RED, |
66 | 66 | ) |
67 | 67 |
|
68 | 68 | graph_pods = graphs.Graph( |
|
82 | 82 | name='deployments_replicas', |
83 | 83 | title=Title('Deployments Replicas'), |
84 | 84 | unit=metrics.Unit(metrics.DecimalNotation("")), |
85 | | - color=Color.DARK_GREEN, |
| 85 | + color=metrics.Color.DARK_GREEN, |
86 | 86 | ) |
87 | 87 |
|
88 | 88 | metric_deployments_ready_replicas = metrics.Metric( |
89 | 89 | name='deployments_ready_replicas', |
90 | 90 | title=Title('Deployments Ready Replicas'), |
91 | 91 | unit=metrics.Unit(metrics.DecimalNotation("")), |
92 | | - color=Color.GREEN, |
| 92 | + color=metrics.Color.GREEN, |
93 | 93 | ) |
94 | 94 |
|
95 | 95 | metric_deployments_unavailable_replicas = metrics.Metric( |
96 | 96 | name='deployments_unavailable_replicas', |
97 | 97 | title=Title('Deployments Unavailable Replicas'), |
98 | 98 | unit=metrics.Unit(metrics.DecimalNotation("")), |
99 | | - color=Color.RED, |
| 99 | + color=metrics.Color.RED, |
100 | 100 | ) |
101 | 101 |
|
102 | 102 | graph_deployments = graphs.Graph( |
|
115 | 115 | name='daemonsets_current_number_scheduled', |
116 | 116 | title=Title('DaemonSets Current Number Scheduled'), |
117 | 117 | unit=metrics.Unit(metrics.DecimalNotation("")), |
118 | | - color=Color.DARK_GREEN, |
| 118 | + color=metrics.Color.DARK_GREEN, |
119 | 119 | ) |
120 | 120 |
|
121 | 121 | metric_daemonsets_desired_number_scheduled = metrics.Metric( |
122 | 122 | name='daemonsets_desired_number_scheduled', |
123 | 123 | title=Title('DaemonSets Desired Number Scheduled'), |
124 | 124 | unit=metrics.Unit(metrics.DecimalNotation("")), |
125 | | - color=Color.GREEN, |
| 125 | + color=metrics.Color.GREEN, |
126 | 126 | ) |
127 | 127 |
|
128 | 128 | metric_daemonsets_number_ready = metrics.Metric( |
129 | 129 | name='daemonsets_number_ready', |
130 | 130 | title=Title('DaemonSets Number Ready'), |
131 | 131 | unit=metrics.Unit(metrics.DecimalNotation("")), |
132 | | - color=Color.LIGHT_GREEN, |
| 132 | + color=metrics.Color.LIGHT_GREEN, |
133 | 133 | ) |
134 | 134 |
|
135 | 135 | metric_daemonsets_number_unavailable = metrics.Metric( |
136 | 136 | name='daemonsets_number_unavailable', |
137 | 137 | title=Title('DaemonSets Number Unavailable'), |
138 | 138 | unit=metrics.Unit(metrics.DecimalNotation("")), |
139 | | - color=Color.RED, |
| 139 | + color=metrics.Color.RED, |
140 | 140 | ) |
141 | 141 |
|
142 | 142 | graph_daemonsets = graphs.Graph( |
|
156 | 156 | name='cronjobs_active', |
157 | 157 | title=Title('CronJobs Active'), |
158 | 158 | unit=metrics.Unit(metrics.DecimalNotation("")), |
159 | | - color=Color.DARK_GREEN, |
| 159 | + color=metrics.Color.DARK_GREEN, |
160 | 160 | ) |
161 | 161 |
|
162 | 162 | # --- ReplicaSets --- |
|
165 | 165 | name='replicasets_replicas', |
166 | 166 | title=Title('ReplicaSets Replicas'), |
167 | 167 | unit=metrics.Unit(metrics.DecimalNotation("")), |
168 | | - color=Color.DARK_GREEN, |
| 168 | + color=metrics.Color.DARK_GREEN, |
169 | 169 | ) |
170 | 170 |
|
171 | 171 | metric_replicasets_ready_replicas = metrics.Metric( |
172 | 172 | name='replicasets_ready_replicas', |
173 | 173 | title=Title('ReplicaSets Ready Replicas'), |
174 | 174 | unit=metrics.Unit(metrics.DecimalNotation("")), |
175 | | - color=Color.GREEN, |
| 175 | + color=metrics.Color.GREEN, |
176 | 176 | ) |
177 | 177 |
|
178 | 178 | metric_replicasets_unavailable_replicas = metrics.Metric( |
179 | 179 | name='replicasets_unavailable_replicas', |
180 | 180 | title=Title('ReplicaSets Unavailable Replicas'), |
181 | 181 | unit=metrics.Unit(metrics.DecimalNotation("")), |
182 | | - color=Color.RED, |
| 182 | + color=metrics.Color.RED, |
183 | 183 | ) |
184 | 184 |
|
185 | 185 | graph_replicasets = graphs.Graph( |
|
0 commit comments