diff --git a/README.md b/README.md index 2b843beb..64a6b72f 100755 --- a/README.md +++ b/README.md @@ -38,9 +38,11 @@ Supported metrics right now as follows. Global: * _System/SensorInfo_ + * `fortigate_sensor_alarm_status` * `fortigate_sensor_fan_rpm` * `fortigate_sensor_temperature_celsius` * `fortigate_sensor_voltage_volts` + * `fortigate_sensor_thresholds` * _System/Status_ * `fortigate_version_info` * _System/Time/Clock_ diff --git a/pkg/probe/probe_test.go b/pkg/probe/probe_test.go index 0d0e5583..0e963230 100644 --- a/pkg/probe/probe_test.go +++ b/pkg/probe/probe_test.go @@ -107,7 +107,7 @@ func (p *testProbeCollector) Describe(c chan<- *prometheus.Desc) { func testProbe(pf probeFunc, c http.FortiHTTP, r Registry) bool { meta := &TargetMetadata{ VersionMajor: 7, - VersionMinor: 0, + VersionMinor: 4, } return testProbeWithMetadata(pf, c, meta, r) } diff --git a/pkg/probe/system_sensor_info.go b/pkg/probe/system_sensor_info.go index 20d3b466..d852f58a 100644 --- a/pkg/probe/system_sensor_info.go +++ b/pkg/probe/system_sensor_info.go @@ -15,21 +15,12 @@ package probe import ( "log" + "reflect" "github.com/prometheus-community/fortigate_exporter/pkg/http" "github.com/prometheus/client_golang/prometheus" ) -type SystemSensorInfoResults struct { - Name string `json:"name"` - Type string `json:"type"` - Value float64 `json:"value"` -} - -type SystemSensorInfo struct { - Results []SystemSensorInfoResults `json:"results"` -} - func probeSystemSensorInfo(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) { var ( sensorTemperature = prometheus.NewDesc( @@ -47,8 +38,39 @@ func probeSystemSensorInfo(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus "Sensor voltage in volts", []string{"name"}, nil, ) + sensorAlarm = prometheus.NewDesc( + "fortigate_sensor_alarm_status", + "Sensor alarm status", + []string{"name"}, nil, + ) + sensorThresholds = prometheus.NewDesc( + "fortigate_sensor_thresholds", + "Sensor threasholds", + []string{"name", "threshold"}, nil, + ) ) + type SystemSensorInfoResultsThresholds struct { + LowerNonRec float64 `json:"lower_non_recoverable,omitempty"` + LowerCrit float64 `json:"lower_critical,omitempty"` + LowerNonCrit float64 `json:"lower_non_critical,omitempty"` + UpperNonCrit float64 `json:"upper_non_critical,omitempty"` + UpperCrit float64 `json:"upper_critical,omitempty"` + UpperNonRec float64 `json:"upper_non_recoverable,omitempty"` + } + + type SystemSensorInfoResults struct { + Name string `json:"name"` + Type string `json:"type"` + Value float64 `json:"value"` + Alarm bool `json:"alarm"` + Thresholds SystemSensorInfoResultsThresholds `json:"thresholds"` + } + + type SystemSensorInfo struct { + Results []SystemSensorInfoResults `json:"results"` + } + var res SystemSensorInfo if err := c.Get("api/v2/monitor/system/sensor-info", "vdom=root", &res); err != nil { log.Printf("Warning: %v", err) @@ -57,6 +79,21 @@ func probeSystemSensorInfo(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus m := []prometheus.Metric{} for _, r := range res.Results { + switch meta.VersionMajor { + case 7: + alarm := 0.0 + if r.Alarm { + alarm = 1.0 + } + m = append(m, prometheus.MustNewConstMetric(sensorAlarm, prometheus.GaugeValue, alarm, r.Name)) + v := reflect.ValueOf(r.Thresholds) + + for i := range v.NumField() { + if v.Field(i).Float() != 0 { + m = append(m, prometheus.MustNewConstMetric(sensorThresholds, prometheus.GaugeValue, v.Field(i).Float(), r.Name, v.Type().Field(i).Name)) + } + } + } switch r.Type { case "temperature": m = append(m, prometheus.MustNewConstMetric(sensorTemperature, prometheus.GaugeValue, r.Value, r.Name)) diff --git a/pkg/probe/system_sensor_info_test.go b/pkg/probe/system_sensor_info_test.go index c087db44..b3531c0f 100755 --- a/pkg/probe/system_sensor_info_test.go +++ b/pkg/probe/system_sensor_info_test.go @@ -30,6 +30,71 @@ func TestSystemSensorInfo(t *testing.T) { } em := ` + # HELP fortigate_sensor_alarm_status Sensor alarm status + # TYPE fortigate_sensor_alarm_status gauge + fortigate_sensor_alarm_status{name="+12V"} 0 + fortigate_sensor_alarm_status{name="+3.3VSB"} 0 + fortigate_sensor_alarm_status{name="+3.3VSB_SMC"} 0 + fortigate_sensor_alarm_status{name="3VDD"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 0"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 1"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 2"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 3"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 4"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 5"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 6"} 0 + fortigate_sensor_alarm_status{name="CPU 0 Core 7"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 0"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 1"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 2"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 3"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 4"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 5"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 6"} 0 + fortigate_sensor_alarm_status{name="CPU 1 Core 7"} 0 + fortigate_sensor_alarm_status{name="CPU0 PVCCIN"} 0 + fortigate_sensor_alarm_status{name="CPU1 PVCCIN"} 0 + fortigate_sensor_alarm_status{name="DTS CPU0"} 0 + fortigate_sensor_alarm_status{name="DTS CPU1"} 0 + fortigate_sensor_alarm_status{name="FAN1"} 0 + fortigate_sensor_alarm_status{name="FAN2"} 0 + fortigate_sensor_alarm_status{name="FAN3"} 0 + fortigate_sensor_alarm_status{name="FAN4"} 0 + fortigate_sensor_alarm_status{name="FAN5"} 0 + fortigate_sensor_alarm_status{name="FAN6"} 0 + fortigate_sensor_alarm_status{name="MAC_1.025V"} 0 + fortigate_sensor_alarm_status{name="MAC_AVS 1V"} 0 + fortigate_sensor_alarm_status{name="P1V05_PCH"} 0 + fortigate_sensor_alarm_status{name="P3V3_AUX"} 0 + fortigate_sensor_alarm_status{name="PS1 Fan 1"} 0 + fortigate_sensor_alarm_status{name="PS1 Status"} 0 + fortigate_sensor_alarm_status{name="PS1 Temp"} 0 + fortigate_sensor_alarm_status{name="PS1 VIN"} 0 + fortigate_sensor_alarm_status{name="PS1 VOUT_12V"} 0 + fortigate_sensor_alarm_status{name="PS2 Fan 1"} 0 + fortigate_sensor_alarm_status{name="PS2 Status"} 1 + fortigate_sensor_alarm_status{name="PS2 Temp"} 0 + fortigate_sensor_alarm_status{name="PS2 VIN"} 0 + fortigate_sensor_alarm_status{name="PS2 VOUT_12V"} 0 + fortigate_sensor_alarm_status{name="PVCCIO"} 0 + fortigate_sensor_alarm_status{name="PVDDQ AB"} 0 + fortigate_sensor_alarm_status{name="PVDDQ EF"} 0 + fortigate_sensor_alarm_status{name="PVTT AB"} 0 + fortigate_sensor_alarm_status{name="PVTT CD"} 0 + fortigate_sensor_alarm_status{name="PVTT GH"} 0 + fortigate_sensor_alarm_status{name="TD1"} 0 + fortigate_sensor_alarm_status{name="TD2"} 0 + fortigate_sensor_alarm_status{name="TD3"} 0 + fortigate_sensor_alarm_status{name="TD4"} 0 + fortigate_sensor_alarm_status{name="TS1"} 0 + fortigate_sensor_alarm_status{name="TS2"} 0 + fortigate_sensor_alarm_status{name="TS3"} 0 + fortigate_sensor_alarm_status{name="TS4"} 0 + fortigate_sensor_alarm_status{name="TS5"} 0 + fortigate_sensor_alarm_status{name="VCC1.15V"} 0 + fortigate_sensor_alarm_status{name="VCC2.5V"} 0 + fortigate_sensor_alarm_status{name="VCC3V3"} 0 + fortigate_sensor_alarm_status{name="VCC5V"} 0 # HELP fortigate_sensor_fan_rpm Sensor fan rotation speed in RPM # TYPE fortigate_sensor_fan_rpm gauge fortigate_sensor_fan_rpm{name="FAN1"} 2900 @@ -71,6 +136,284 @@ func TestSystemSensorInfo(t *testing.T) { fortigate_sensor_temperature_celsius{name="TS3"} 32 fortigate_sensor_temperature_celsius{name="TS4"} 32 fortigate_sensor_temperature_celsius{name="TS5"} 31 + # HELP fortigate_sensor_thresholds Sensor threasholds + # TYPE fortigate_sensor_thresholds gauge + fortigate_sensor_thresholds{name="+12V",threshold="LowerCrit"} 10.307 + fortigate_sensor_thresholds{name="+12V",threshold="LowerNonCrit"} 10.897 + fortigate_sensor_thresholds{name="+12V",threshold="LowerNonRec"} 9.953 + fortigate_sensor_thresholds{name="+12V",threshold="UpperCrit"} 13.729 + fortigate_sensor_thresholds{name="+12V",threshold="UpperNonCrit"} 12.962 + fortigate_sensor_thresholds{name="+12V",threshold="UpperNonRec"} 14.083 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="LowerCrit"} 2.928 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="LowerNonCrit"} 3.072 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="LowerNonRec"} 2.88 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="UpperCrit"} 3.648 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="UpperNonCrit"} 3.552 + fortigate_sensor_thresholds{name="+3.3VSB",threshold="UpperNonRec"} 3.696 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="LowerCrit"} 2.928 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="LowerNonCrit"} 3.072 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="LowerNonRec"} 2.88 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="UpperCrit"} 3.648 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="UpperNonCrit"} 3.552 + fortigate_sensor_thresholds{name="+3.3VSB_SMC",threshold="UpperNonRec"} 3.696 + fortigate_sensor_thresholds{name="3VDD",threshold="LowerCrit"} 2.928 + fortigate_sensor_thresholds{name="3VDD",threshold="LowerNonCrit"} 3.072 + fortigate_sensor_thresholds{name="3VDD",threshold="LowerNonRec"} 2.88 + fortigate_sensor_thresholds{name="3VDD",threshold="UpperCrit"} 3.648 + fortigate_sensor_thresholds{name="3VDD",threshold="UpperNonCrit"} 3.552 + fortigate_sensor_thresholds{name="3VDD",threshold="UpperNonRec"} 3.696 + fortigate_sensor_thresholds{name="CPU 0 Core 0",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 0",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 0",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 1",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 1",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 1",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 3",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 3",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 3",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 4",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 4",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 4",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 5",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 5",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 5",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 6",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 6",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 6",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 0 Core 7",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 0 Core 7",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 0 Core 7",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 0",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 0",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 0",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 1",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 1",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 1",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 2",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 2",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 2",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 3",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 3",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 3",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 4",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 4",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 4",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 5",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 5",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 5",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 6",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 6",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 6",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU 1 Core 7",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="CPU 1 Core 7",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="CPU 1 Core 7",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="LowerCrit"} 1.344 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="LowerNonCrit"} 1.392 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="LowerNonRec"} 1.312 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="UpperCrit"} 2.032 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="UpperNonCrit"} 1.968 + fortigate_sensor_thresholds{name="CPU0 PVCCIN",threshold="UpperNonRec"} 2.064 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="LowerCrit"} 1.344 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="LowerNonCrit"} 1.392 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="LowerNonRec"} 1.312 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="UpperCrit"} 2.032 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="UpperNonCrit"} 1.968 + fortigate_sensor_thresholds{name="CPU1 PVCCIN",threshold="UpperNonRec"} 2.064 + fortigate_sensor_thresholds{name="DTS CPU0",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="DTS CPU0",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="DTS CPU0",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="DTS CPU1",threshold="UpperCrit"} 100 + fortigate_sensor_thresholds{name="DTS CPU1",threshold="UpperNonCrit"} 95 + fortigate_sensor_thresholds{name="DTS CPU1",threshold="UpperNonRec"} 105 + fortigate_sensor_thresholds{name="FAN1",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN1",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN1",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN1",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN1",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN1",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="FAN2",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN2",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN2",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN2",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN2",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN2",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="FAN3",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN3",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN3",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN3",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN3",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN3",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="FAN4",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN4",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN4",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN4",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN4",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN4",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="FAN5",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN5",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN5",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN5",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN5",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN5",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="FAN6",threshold="LowerCrit"} 1000 + fortigate_sensor_thresholds{name="FAN6",threshold="LowerNonCrit"} 1500 + fortigate_sensor_thresholds{name="FAN6",threshold="LowerNonRec"} 500 + fortigate_sensor_thresholds{name="FAN6",threshold="UpperCrit"} 11000 + fortigate_sensor_thresholds{name="FAN6",threshold="UpperNonCrit"} 10000 + fortigate_sensor_thresholds{name="FAN6",threshold="UpperNonRec"} 12000 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="LowerCrit"} 0.9192 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="LowerNonCrit"} 0.9486 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="LowerNonRec"} 0.8996 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="UpperCrit"} 1.1348 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="UpperNonCrit"} 1.1054 + fortigate_sensor_thresholds{name="MAC_1.025V",threshold="UpperNonRec"} 1.1544 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="LowerCrit"} 0.892 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="LowerNonCrit"} 0.9214 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="LowerNonRec"} 0.8724 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="UpperCrit"} 1.1076 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="UpperNonCrit"} 1.0782 + fortigate_sensor_thresholds{name="MAC_AVS 1V",threshold="UpperNonRec"} 1.1272 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="LowerCrit"} 0.864 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="LowerNonCrit"} 0.912 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="LowerNonRec"} 0.816 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="UpperCrit"} 1.248 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="UpperNonCrit"} 1.2 + fortigate_sensor_thresholds{name="P1V05_PCH",threshold="UpperNonRec"} 1.296 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="LowerCrit"} 2.9703 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="LowerNonCrit"} 3.0844 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="LowerNonRec"} 2.9051 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="UpperCrit"} 3.6223 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="UpperNonCrit"} 3.5245 + fortigate_sensor_thresholds{name="P3V3_AUX",threshold="UpperNonRec"} 3.6875 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="LowerCrit"} 256 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="LowerNonCrit"} 384 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="LowerNonRec"} 128 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="UpperCrit"} 25600 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="UpperNonCrit"} 24576 + fortigate_sensor_thresholds{name="PS1 Fan 1",threshold="UpperNonRec"} 26880 + fortigate_sensor_thresholds{name="PS1 Temp",threshold="UpperCrit"} 65 + fortigate_sensor_thresholds{name="PS1 Temp",threshold="UpperNonCrit"} 60 + fortigate_sensor_thresholds{name="PS1 Temp",threshold="UpperNonRec"} 70 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="LowerCrit"} 36 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="LowerNonCrit"} 38 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="LowerNonRec"} 34 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="UpperCrit"} 300 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="UpperNonCrit"} 292 + fortigate_sensor_thresholds{name="PS1 VIN",threshold="UpperNonRec"} 306 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="LowerCrit"} 9.512 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="LowerNonCrit"} 10.016 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="LowerNonRec"} 9.197 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="UpperCrit"} 14.867 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="UpperNonCrit"} 14.048 + fortigate_sensor_thresholds{name="PS1 VOUT_12V",threshold="UpperNonRec"} 15.245 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="LowerCrit"} 256 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="LowerNonCrit"} 384 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="LowerNonRec"} 128 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="UpperCrit"} 25600 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="UpperNonCrit"} 24576 + fortigate_sensor_thresholds{name="PS2 Fan 1",threshold="UpperNonRec"} 26880 + fortigate_sensor_thresholds{name="PS2 Temp",threshold="UpperCrit"} 65 + fortigate_sensor_thresholds{name="PS2 Temp",threshold="UpperNonCrit"} 60 + fortigate_sensor_thresholds{name="PS2 Temp",threshold="UpperNonRec"} 70 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="LowerCrit"} 36 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="LowerNonCrit"} 38 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="LowerNonRec"} 34 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="UpperCrit"} 300 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="UpperNonCrit"} 292 + fortigate_sensor_thresholds{name="PS2 VIN",threshold="UpperNonRec"} 306 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="LowerCrit"} 9.512 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="LowerNonCrit"} 10.016 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="LowerNonRec"} 9.197 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="UpperCrit"} 14.867 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="UpperNonCrit"} 14.048 + fortigate_sensor_thresholds{name="PS2 VOUT_12V",threshold="UpperNonRec"} 15.245 + fortigate_sensor_thresholds{name="PVCCIO",threshold="LowerCrit"} 0.864 + fortigate_sensor_thresholds{name="PVCCIO",threshold="LowerNonCrit"} 0.896 + fortigate_sensor_thresholds{name="PVCCIO",threshold="LowerNonRec"} 0.848 + fortigate_sensor_thresholds{name="PVCCIO",threshold="UpperCrit"} 1.184 + fortigate_sensor_thresholds{name="PVCCIO",threshold="UpperNonCrit"} 1.152 + fortigate_sensor_thresholds{name="PVCCIO",threshold="UpperNonRec"} 1.2 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="LowerCrit"} 1.088 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="LowerNonCrit"} 1.12 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="LowerNonRec"} 1.056 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="UpperCrit"} 1.312 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="UpperNonCrit"} 1.28 + fortigate_sensor_thresholds{name="PVDDQ AB",threshold="UpperNonRec"} 1.344 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="LowerCrit"} 1.088 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="LowerNonCrit"} 1.12 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="LowerNonRec"} 1.056 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="UpperCrit"} 1.312 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="UpperNonCrit"} 1.28 + fortigate_sensor_thresholds{name="PVDDQ EF",threshold="UpperNonRec"} 1.344 + fortigate_sensor_thresholds{name="PVTT AB",threshold="LowerCrit"} 0.528 + fortigate_sensor_thresholds{name="PVTT AB",threshold="LowerNonCrit"} 0.56 + fortigate_sensor_thresholds{name="PVTT AB",threshold="LowerNonRec"} 0.512 + fortigate_sensor_thresholds{name="PVTT AB",threshold="UpperCrit"} 0.656 + fortigate_sensor_thresholds{name="PVTT AB",threshold="UpperNonCrit"} 0.64 + fortigate_sensor_thresholds{name="PVTT AB",threshold="UpperNonRec"} 0.672 + fortigate_sensor_thresholds{name="PVTT CD",threshold="LowerCrit"} 0.528 + fortigate_sensor_thresholds{name="PVTT CD",threshold="LowerNonCrit"} 0.56 + fortigate_sensor_thresholds{name="PVTT CD",threshold="LowerNonRec"} 0.512 + fortigate_sensor_thresholds{name="PVTT CD",threshold="UpperCrit"} 0.656 + fortigate_sensor_thresholds{name="PVTT CD",threshold="UpperNonCrit"} 0.64 + fortigate_sensor_thresholds{name="PVTT CD",threshold="UpperNonRec"} 0.672 + fortigate_sensor_thresholds{name="PVTT GH",threshold="LowerCrit"} 0.528 + fortigate_sensor_thresholds{name="PVTT GH",threshold="LowerNonCrit"} 0.56 + fortigate_sensor_thresholds{name="PVTT GH",threshold="LowerNonRec"} 0.512 + fortigate_sensor_thresholds{name="PVTT GH",threshold="UpperCrit"} 0.656 + fortigate_sensor_thresholds{name="PVTT GH",threshold="UpperNonCrit"} 0.64 + fortigate_sensor_thresholds{name="PVTT GH",threshold="UpperNonRec"} 0.672 + fortigate_sensor_thresholds{name="TD1",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TD1",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TD1",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="TD2",threshold="UpperCrit"} 75 + fortigate_sensor_thresholds{name="TD2",threshold="UpperNonCrit"} 70 + fortigate_sensor_thresholds{name="TD2",threshold="UpperNonRec"} 80 + fortigate_sensor_thresholds{name="TD3",threshold="UpperCrit"} 65 + fortigate_sensor_thresholds{name="TD3",threshold="UpperNonCrit"} 60 + fortigate_sensor_thresholds{name="TD3",threshold="UpperNonRec"} 70 + fortigate_sensor_thresholds{name="TD4",threshold="UpperCrit"} 65 + fortigate_sensor_thresholds{name="TD4",threshold="UpperNonCrit"} 60 + fortigate_sensor_thresholds{name="TD4",threshold="UpperNonRec"} 70 + fortigate_sensor_thresholds{name="TS1",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TS1",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TS1",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="TS2",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TS2",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TS2",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="TS3",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TS3",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TS3",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="TS4",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TS4",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TS4",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="TS5",threshold="UpperCrit"} 70 + fortigate_sensor_thresholds{name="TS5",threshold="UpperNonCrit"} 65 + fortigate_sensor_thresholds{name="TS5",threshold="UpperNonRec"} 75 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="LowerCrit"} 1.0307 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="LowerNonCrit"} 1.0699 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="LowerNonRec"} 1.0111 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="UpperCrit"} 1.2659 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="UpperNonCrit"} 1.2365 + fortigate_sensor_thresholds{name="VCC1.15V",threshold="UpperNonRec"} 1.2855 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="LowerCrit"} 2.2709 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="LowerNonCrit"} 2.3447 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="LowerNonRec"} 2.2094 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="UpperCrit"} 2.7383 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="UpperNonCrit"} 2.6645 + fortigate_sensor_thresholds{name="VCC2.5V",threshold="UpperNonRec"} 2.7875 + fortigate_sensor_thresholds{name="VCC3V3",threshold="LowerCrit"} 2.9703 + fortigate_sensor_thresholds{name="VCC3V3",threshold="LowerNonCrit"} 3.0844 + fortigate_sensor_thresholds{name="VCC3V3",threshold="LowerNonRec"} 2.9051 + fortigate_sensor_thresholds{name="VCC3V3",threshold="UpperCrit"} 3.6223 + fortigate_sensor_thresholds{name="VCC3V3",threshold="UpperNonCrit"} 3.5245 + fortigate_sensor_thresholds{name="VCC3V3",threshold="UpperNonRec"} 3.6875 + fortigate_sensor_thresholds{name="VCC5V",threshold="LowerCrit"} 4.46 + fortigate_sensor_thresholds{name="VCC5V",threshold="LowerNonCrit"} 4.607 + fortigate_sensor_thresholds{name="VCC5V",threshold="LowerNonRec"} 4.362 + fortigate_sensor_thresholds{name="VCC5V",threshold="UpperCrit"} 5.538 + fortigate_sensor_thresholds{name="VCC5V",threshold="UpperNonCrit"} 5.391 + fortigate_sensor_thresholds{name="VCC5V",threshold="UpperNonRec"} 5.636 # HELP fortigate_sensor_voltage_volts Sensor voltage in volts # TYPE fortigate_sensor_voltage_volts gauge fortigate_sensor_voltage_volts{name="+12V"} 12.077 diff --git a/pkg/probe/testdata/system-sensor-info.jsonnet b/pkg/probe/testdata/system-sensor-info.jsonnet index 17826bb3..317b9108 100644 --- a/pkg/probe/testdata/system-sensor-info.jsonnet +++ b/pkg/probe/testdata/system-sensor-info.jsonnet @@ -152,11 +152,7 @@ "type":"temperature", "value":42.000000, "alarm":false, - "thresholds":{ - "upper_non_critical":95.000000, - "upper_critical":100.000000, - "upper_non_recoverable":105.000000 - } + "thresholds":{} }, { "id":"temperature.cpu_0_core_3", @@ -847,7 +843,7 @@ "name":"PS2 Status", "type":"power", "value":0.000000, - "alarm":false, + "alarm":true, "thresholds":{ "upper_non_critical":0.000000, "upper_critical":0.000000,