Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions snmp/changelog.d/25010.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``fgHwSensorValue`` and ``fgHwSensorAlarmStatus`` metrics from the FortiGate hardware sensor table.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions snmp/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,,
Expand Down
8 changes: 8 additions & 0 deletions snmp/tests/compose/data/fortinet-fortigate.snmprec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
]
Expand Down
10 changes: 10 additions & 0 deletions snmp/tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
Loading