@@ -38,6 +38,7 @@ type NodesMetrics struct {
38
38
maint map [string ]float64
39
39
mix map [string ]float64
40
40
resv map [string ]float64
41
+ other map [string ]float64
41
42
total map [string ]float64
42
43
}
43
44
@@ -74,6 +75,7 @@ func InitFeatureSet(nm *NodesMetrics, feature_set string) {
74
75
nm .maint [feature_set ] = nm .maint [feature_set ]
75
76
nm .mix [feature_set ] = nm .mix [feature_set ]
76
77
nm .resv [feature_set ] = nm .resv [feature_set ]
78
+ nm .other [feature_set ] = nm .other [feature_set ]
77
79
nm .total [feature_set ] = nm .total [feature_set ]
78
80
}
79
81
@@ -96,6 +98,7 @@ func ParseNodesMetrics(input []byte) *NodesMetrics {
96
98
nm .maint = make (map [string ]float64 )
97
99
nm .mix = make (map [string ]float64 )
98
100
nm .resv = make (map [string ]float64 )
101
+ nm .other = make (map [string ]float64 )
99
102
nm .total = make (map [string ]float64 )
100
103
101
104
for _ , line := range lines_uniq {
@@ -141,6 +144,8 @@ func ParseNodesMetrics(input []byte) *NodesMetrics {
141
144
nm .mix [feature_set ] += count
142
145
case resv .MatchString (state ):
143
146
nm .resv [feature_set ] += count
147
+ default :
148
+ nm .other [feature_set ] += count
144
149
}
145
150
}
146
151
}
@@ -225,6 +230,7 @@ func NewNodesCollector() *NodesCollector {
225
230
maint : prometheus .NewDesc ("slurm_nodes_maint" , "Maint nodes" , labelnames , nil ),
226
231
mix : prometheus .NewDesc ("slurm_nodes_mix" , "Mix nodes" , labelnames , nil ),
227
232
resv : prometheus .NewDesc ("slurm_nodes_resv" , "Reserved nodes" , labelnames , nil ),
233
+ other : prometheus .NewDesc ("slurm_nodes_other" , "Nodes reported with an unknown state" , labelnames , nil ),
228
234
total : prometheus .NewDesc ("slurm_nodes_total" , "Total number of nodes" , nil , nil ),
229
235
}
230
236
}
@@ -240,6 +246,7 @@ type NodesCollector struct {
240
246
maint * prometheus.Desc
241
247
mix * prometheus.Desc
242
248
resv * prometheus.Desc
249
+ other * prometheus.Desc
243
250
total * prometheus.Desc
244
251
}
245
252
@@ -255,6 +262,7 @@ func (nc *NodesCollector) Describe(ch chan<- *prometheus.Desc) {
255
262
ch <- nc .maint
256
263
ch <- nc .mix
257
264
ch <- nc .resv
265
+ ch <- nc .other
258
266
ch <- nc .total
259
267
}
260
268
@@ -282,6 +290,7 @@ func (nc *NodesCollector) Collect(ch chan<- prometheus.Metric) {
282
290
SendFeatureSetMetric (ch , nc .maint , prometheus .GaugeValue , nm .maint , part )
283
291
SendFeatureSetMetric (ch , nc .mix , prometheus .GaugeValue , nm .mix , part )
284
292
SendFeatureSetMetric (ch , nc .resv , prometheus .GaugeValue , nm .resv , part )
293
+ SendFeatureSetMetric (ch , nc .other , prometheus .GaugeValue , nm .other , part )
285
294
}
286
295
total := SlurmGetTotal ()
287
296
ch <- prometheus .MustNewConstMetric (nc .total , prometheus .GaugeValue , total )
0 commit comments