Skip to content

Add FortiGate hardware sensor table support - #25010

Open
matthewleese wants to merge 7 commits into
masterfrom
mleese/frndm-506-fortigate-hw-sensors
Open

matthewleese wants to merge 7 commits into
masterfrom
mleese/frndm-506-fortigate-hw-sensors

Conversation

@matthewleese

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds two new table-based metrics from FORTINET-FORTIGATE-MIB's fgHwSensorTable: fgHwSensorValue (numeric sensor reading) and fgHwSensorAlarmStatus (whether the sensor is out of normal range), tagged by sensor_index and sensor_name.

Motivation

FRNDM-506: expose FortiGate hardware sensor data (temperature, fan speed, voltage, etc., depending on device model) which is currently unmapped in the profile.

Caveat, please read before merging

fgHwSensorEntValue is a DisplayString, not a number. Its exact format (units, precision, e.g. "25.0 C" vs "3300" vs "12 V") isn't documented in the MIB and varies by sensor type and device model. This PR extracts the leading numeric portion via extract_value: '(\d+(?:\.\d+)?)', following the same pattern used elsewhere in this repo (e.g. ibm-lenovo-server.yaml).

I could not verify this regex against a live FortiGate device or a real customer snmpwalk, so it may not match every device's exact value string format. The e2e fixture uses representative but synthetic values ("25.0 C", "3300"). Recommend validating against a real device or customer-provided snmpwalk output before merging, or treating this as a starting point to refine.

Review checklist

  • Profile YAML change (fortinet-fortigate.yaml)
  • .snmprec fixture rows added (2 sensors, ordered numerically to fit the existing subtree)
  • e2e test updated to assert the new metrics/tags

Note: This PR was created by Claude

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Pipelines  Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 93.81% (+4.11%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8e85f65 | Docs | View more details | Give us feedback!

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

evalya-impact-summary

Evalya CI impact

Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   4 (always emitted)
Changed files:   6

Full impact report
Learn more about CI impact filtering

@matthewleese matthewleese added the qa/required QA is required for this PR and will generate a QA card label Aug 26, 2026
@matthewleese
matthewleese marked this pull request as ready for review August 28, 2026 17:44
@matthewleese
matthewleese requested review from a team as code owners August 28, 2026 17:44
@matthewleese
matthewleese requested review from NouhaManai96 and removed request for a team August 28, 2026 17:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd31c7f2cc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread snmp/datadog_checks/snmp/data/default_profiles/fortinet-fortigate.yaml Outdated
@chouetz chouetz added the internal Identify a non-fork PR label Oct 2, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Dispatcher tests: passed

Dispatcher beta: informational only
Existing CI remains the merge signal.

  6/6 jobs

✅ 6 passed · nothing failed

Batches · ✅ batch-01 6/6

Dispatcher finished on 4d85af4 — GitHub Run · Dispatcher Logs.

@dd-octo-sts

dd-octo-sts Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Disk usage change

Commit 8e85f65 compared against 4729067.

Uncompressed

linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB
Details
Name Version Type linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
snmp 13.4.0 Integration 🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB 🔺 +1.35 KiB

Compressed

linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
🔺 +290 B 🔺 +290 B 🔺 +290 B 🔺 +290 B 🔺 +290 B
Details
Name Version Type linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
snmp 13.4.0 Integration 🔺 +290 B 🔺 +290 B 🔺 +290 B 🔺 +290 B 🔺 +290 B

matthewleese and others added 6 commits October 28, 2026 10:02
FRNDM-506: expose FORTINET-FORTIGATE-MIB's fgHwSensorTable
(temperature, fan speed, voltage, etc., depending on device model),
tagged by sensor_index and sensor_name, plus the per-sensor
fgHwSensorAlarmStatus.

fgHwSensorEntValue is a DisplayString whose exact format (units,
precision) isn't documented and varies by sensor/device model, so
fgHwSensorValue uses extract_value to pull the leading numeric portion
out of it. This wasn't verified against a live device or a customer
snmpwalk, so the regex may not match every device's exact value
format; the e2e fixture uses representative but synthetic values
('25.0 C', '3300').

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The unit test's assert_all_metrics_covered() and the metadata.csv
description file both needed to know about fgHwSensorValue and
fgHwSensorAlarmStatus, or CI fails with "metrics are collected but
not asserted".
ruff format collapses a call onto one line when it fits within the
line-length limit; the multi-line form was flagged by the CI lint gate.
validate-assets and validate-logs_validator failed with an internal
Datadog system error unrelated to this PR's content ("not a problem
with your assets" / "contact Datadog"). Isolated to this PR among
recent open PRs, so retriggering rather than changing anything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fgHwSensorTable covers temperature and voltage sensors, which can
report negative readings; the regex only matched from an unsigned
digit, so a leading minus sign made extract_value fail and dropped
the metric entirely.
@matthewleese
matthewleese force-pushed the mleese/frndm-506-fortigate-hw-sensors branch from e90fd82 to dc4bc2c Compare October 28, 2026 14:04
@matthewleese matthewleese added the assets/no-deploy Prevents APW from deploying this PR in staging label Oct 28, 2026
@matthewleese

Copy link
Copy Markdown
Contributor Author

@DataDog please fix my ci

@datadog-official

Copy link
Copy Markdown
Contributor

I can only run on private repositories.

@dd-octo-sts

dd-octo-sts Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 22 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file ✅
ci Validate CI configuration and code coverage settings ✅
codeowners Validate every integration has a CODEOWNERS entry ✅
config Validate default configuration files against spec.yaml ✅
dep Verify dependency pins are consistent and Agent-compatible ✅
http Validate integrations use the HTTP wrapper correctly ✅
imports Validate check imports do not use deprecated modules ✅
integration-style Validate check code style conventions ✅
jmx-metrics Validate JMX metrics definition files and config ✅
labeler Validate PR labeler config matches integration directories ✅
legacy-signature Validate no integration uses the legacy Agent check signature ✅
license-headers Validate Python files have proper license headers ✅
licenses Validate third-party license attribution list ✅
metadata Validate metadata.csv metric definitions ✅
models Validate configuration data models match spec.yaml ✅
openmetrics Validate OpenMetrics integrations disable the metric limit ✅
package Validate Python package metadata, naming, and wheel contents ✅
pr-description Validate the pull request checklist and visible description length ✅
qa-label Validate the pull request declares whether it needs QA for the next Agent release ✅
readmes Validate README files have required sections ✅
saved-views Validate saved view JSON file structure and fields ✅
version Validate version consistency between package and changelog ✅

View full run

@matthewleese

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-30 11:35:14 UTC ℹ️ Start processing command /merge


2026-10-30 11:35:17 UTC ❌ MergeQueue

The merge queue is disabled for this repository/branch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/review-requested assets/no-deploy Prevents APW from deploying this PR in staging ecosystems/review-requested integration/snmp internal Identify a non-fork PR product/review-requested qa/required QA is required for this PR and will generate a QA card team/agent-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants