diff --git a/snmp/changelog.d/25010.added b/snmp/changelog.d/25010.added new file mode 100644 index 0000000000000..29f742bdd628e --- /dev/null +++ b/snmp/changelog.d/25010.added @@ -0,0 +1 @@ +Add ``fgHwSensorValue`` and ``fgHwSensorAlarmStatus`` metrics from the FortiGate hardware sensor table. diff --git a/snmp/datadog_checks/snmp/data/default_profiles/fortinet-fortigate.yaml b/snmp/datadog_checks/snmp/data/default_profiles/fortinet-fortigate.yaml index b73fee3f602be..327aabc5a79a6 100644 --- a/snmp/datadog_checks/snmp/data/default_profiles/fortinet-fortigate.yaml +++ b/snmp/datadog_checks/snmp/data/default_profiles/fortinet-fortigate.yaml @@ -150,6 +150,45 @@ metrics: OID: 1.3.6.1.4.1.12356.101.4.1.7.0 name: fgSysDiskCapacity + ### Hardware Sensors + # Hardware sensor table (temperature, voltage, fan speed, power supply, etc.), if supported by the device. + - MIB: FORTINET-FORTIGATE-MIB + table: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1 + name: fgHwSensorTable + symbols: + # The sensor's current value. This is a DisplayString whose format (units, precision) varies by + # sensor and device model, so only the leading numeric portion is extracted. + - OID: 1.3.6.1.4.1.12356.101.4.3.2.1.3 + name: fgHwSensorValue + extract_value: '(-?\d+(?:\.\d+)?)' + metric_tags: + - tag: sensor_index + symbol: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1.1 + name: fgHwSensorEntIndex + - tag: sensor_name + symbol: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1.2 + name: fgHwSensorEntName + - MIB: FORTINET-FORTIGATE-MIB + table: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1 + name: fgHwSensorTable + symbols: + # Whether the sensor's value is outside of the normal range: false(0), true(1). + - OID: 1.3.6.1.4.1.12356.101.4.3.2.1.4 + name: fgHwSensorAlarmStatus + metric_tags: + - tag: sensor_index + symbol: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1.1 + name: fgHwSensorEntIndex + - tag: sensor_name + symbol: + OID: 1.3.6.1.4.1.12356.101.4.3.2.1.2 + name: fgHwSensorEntName + ### Virtual Domains # A table of virtual domains configured on the device. - MIB: FORTINET-FORTIGATE-MIB diff --git a/snmp/metadata.csv b/snmp/metadata.csv index f2b5162bc9c15..396b5f7db093c 100644 --- a/snmp/metadata.csv +++ b/snmp/metadata.csv @@ -756,6 +756,8 @@ snmp.fgFwPolByteCount,count,,packet,,[Fortinet FortiGate] The number of bytes in snmp.fgFwPolByteCount.rate,gauge,,packet,second,[Fortinet FortiGate] The number of bytes in packets per second matching the policy.,0,snmp,, snmp.fgFwPolPktCount,count,,packet,,[Fortinet FortiGate] The number of packets matched to policy (passed or blocked depending on policy action). Count is from the time the policy became active.,0,snmp,, snmp.fgFwPolPktCount.rate,gauge,,packet,second,[Fortinet FortiGate] The number of packets per second matched to policy (passed or blocked depending on policy action). Count is from the time the policy became active.,0,snmp,, +snmp.fgHwSensorAlarmStatus,gauge,,,,[Fortinet FortiGate] Whether the hardware sensor's value is outside of the normal range: false(0) true(1).,0,snmp,, +snmp.fgHwSensorValue,gauge,,,,[Fortinet FortiGate] The hardware sensor's current value.,0,snmp,, snmp.fgIntfEntVdom,gauge,,,,[Fortinet FortiGate] The virtual domain the interface belongs to. This index corresponds to the index used by fgVdTable.,0,snmp,, snmp.fgProcessorPktDroppedCount,count,,packet,,[Fortinet FortiGate] The total number of packets dropped by this processor.,0,snmp,, snmp.fgProcessorPktDroppedCount.rate,gauge,,packet,second,[Fortinet FortiGate] The total number of packets dropped per second by this processor.,0,snmp,, diff --git a/snmp/tests/compose/data/fortinet-fortigate.snmprec b/snmp/tests/compose/data/fortinet-fortigate.snmprec index 1fd3e07a4cca8..f53a76e4c6e5d 100644 --- a/snmp/tests/compose/data/fortinet-fortigate.snmprec +++ b/snmp/tests/compose/data/fortinet-fortigate.snmprec @@ -50,6 +50,14 @@ 1.3.6.1.4.1.12356.101.4.1.18.0|66|3500286743 1.3.6.1.4.1.12356.101.4.1.19.0|66|1959290694 1.3.6.1.4.1.12356.101.4.1.20.0|70|14789083134851123033 +1.3.6.1.4.1.12356.101.4.3.2.1.1.1|2|1 +1.3.6.1.4.1.12356.101.4.3.2.1.1.2|2|2 +1.3.6.1.4.1.12356.101.4.3.2.1.2.1|4|CPU Temperature +1.3.6.1.4.1.12356.101.4.3.2.1.2.2|4|System Fan Speed +1.3.6.1.4.1.12356.101.4.3.2.1.3.1|4|25.0 C +1.3.6.1.4.1.12356.101.4.3.2.1.3.2|4|3300 +1.3.6.1.4.1.12356.101.4.3.2.1.4.1|2|0 +1.3.6.1.4.1.12356.101.4.3.2.1.4.2|2|0 1.3.6.1.4.1.12356.101.4.4.2.1.1.12|2|12 1.3.6.1.4.1.12356.101.4.4.2.1.2.12|66|44 1.3.6.1.4.1.12356.101.4.4.2.1.6.12|70|6053432544510993268 diff --git a/snmp/tests/test_e2e_core_profiles/test_profile_fortinet_fortigate.py b/snmp/tests/test_e2e_core_profiles/test_profile_fortinet_fortigate.py index 16a0b03d5344a..34737e3dd69fc 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile_fortinet_fortigate.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile_fortinet_fortigate.py @@ -65,6 +65,15 @@ def test_e2e_profile_fortinet_fortigate(dd_agent_check): aggregator.assert_metric('snmp.fgSysSesRate1', metric_type=aggregator.GAUGE, tags=common_tags) aggregator.assert_metric('snmp.fgVdMaxVdoms', metric_type=aggregator.GAUGE, tags=common_tags) aggregator.assert_metric('snmp.fgVdNumber', metric_type=aggregator.GAUGE, tags=common_tags) + + tag_rows = [ + ['sensor_index:1', 'sensor_name:CPU Temperature'], + ['sensor_index:2', 'sensor_name:System Fan Speed'], + ] + for tag_row in tag_rows: + aggregator.assert_metric('snmp.fgHwSensorValue', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + aggregator.assert_metric('snmp.fgHwSensorAlarmStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + tag_rows = [ ['processor_index:12'], ] diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index d31e5ce310531..5771ca94ae670 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -2743,6 +2743,11 @@ def test_fortinet_fortigate(aggregator): ] vd_tags = common_tags + ['virtualdomain_index:4', 'virtualdomain_name:their oxen quaintly'] + hw_sensors = [ + ('1', 'CPU Temperature'), + ('2', 'System Fan Speed'), + ] + common.assert_common_metrics(aggregator, common_tags) aggregator.assert_metric('snmp.ifNumber', metric_type=aggregator.GAUGE, tags=common_tags) @@ -2763,6 +2768,11 @@ def test_fortinet_fortigate(aggregator): for metric in vd_metrics: aggregator.assert_metric('snmp.{}'.format(metric), metric_type=aggregator.GAUGE, tags=vd_tags, count=1) + for sensor_index, sensor_name in hw_sensors: + sensor_tags = common_tags + ['sensor_index:{}'.format(sensor_index), 'sensor_name:{}'.format(sensor_name)] + aggregator.assert_metric('snmp.fgHwSensorValue', metric_type=aggregator.GAUGE, tags=sensor_tags, count=1) + aggregator.assert_metric('snmp.fgHwSensorAlarmStatus', metric_type=aggregator.GAUGE, tags=sensor_tags, count=1) + # Interface aggregator.assert_metric('snmp.fgIntfEntVdom', metric_type=aggregator.GAUGE, count=1)