@@ -21,27 +21,6 @@ import (
2121 "github.com/prometheus/client_golang/prometheus"
2222)
2323
24- type SystemSensorInfoResultsThresholds struct {
25- LowerNonRec float64 `json:"lower_non_recoverable,omitempty"`
26- LowerCrit float64 `json:"lower_critical,omitempty"`
27- LowerNonCrit float64 `json:"lower_non_critical,omitempty"`
28- UpperNonCrit float64 `json:"upper_non_critical,omitempty"`
29- UpperCrit float64 `json:"upper_critical,omitempty"`
30- UpperNonRec float64 `json:"upper_non_recoverable,omitempty"`
31- }
32-
33- type SystemSensorInfoResults struct {
34- Name string `json:"name"`
35- Type string `json:"type"`
36- Value float64 `json:"value"`
37- Alarm bool `json:"alarm"`
38- Thresholds SystemSensorInfoResultsThresholds `json:"thresholds"`
39- }
40-
41- type SystemSensorInfo struct {
42- Results []SystemSensorInfoResults `json:"results"`
43- }
44-
4524func probeSystemSensorInfo (c http.FortiHTTP , meta * TargetMetadata ) ([]prometheus.Metric , bool ) {
4625 var (
4726 sensorTemperature = prometheus .NewDesc (
@@ -71,6 +50,27 @@ func probeSystemSensorInfo(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus
7150 )
7251 )
7352
53+ type SystemSensorInfoResultsThresholds struct {
54+ LowerNonRec float64 `json:"lower_non_recoverable,omitempty"`
55+ LowerCrit float64 `json:"lower_critical,omitempty"`
56+ LowerNonCrit float64 `json:"lower_non_critical,omitempty"`
57+ UpperNonCrit float64 `json:"upper_non_critical,omitempty"`
58+ UpperCrit float64 `json:"upper_critical,omitempty"`
59+ UpperNonRec float64 `json:"upper_non_recoverable,omitempty"`
60+ }
61+
62+ type SystemSensorInfoResults struct {
63+ Name string `json:"name"`
64+ Type string `json:"type"`
65+ Value float64 `json:"value"`
66+ Alarm bool `json:"alarm"`
67+ Thresholds SystemSensorInfoResultsThresholds `json:"thresholds"`
68+ }
69+
70+ type SystemSensorInfo struct {
71+ Results []SystemSensorInfoResults `json:"results"`
72+ }
73+
7474 var res SystemSensorInfo
7575 if err := c .Get ("api/v2/monitor/system/sensor-info" , "vdom=root" , & res ); err != nil {
7676 log .Printf ("Warning: %v" , err )
0 commit comments