Skip to content

Comments

Add system global location probe#363

Open
rnxmlu wants to merge 3 commits intoprometheus-community:mainfrom
rnxmlu:pr-probe-location
Open

Add system global location probe#363
rnxmlu wants to merge 3 commits intoprometheus-community:mainfrom
rnxmlu:pr-probe-location

Conversation

@rnxmlu
Copy link

@rnxmlu rnxmlu commented Feb 5, 2026

This PR introduces a new optional probe that retrieves geographic
coordinates from the FortiOS system global CMDB endpoint and exposes
them as static metadata.

New metric

fortigate_location_info{latitude="<lat>", longitude="<lon>"} 1

The metric is intended for metadata use (e.g. Grafana geomap panels) and
follows the exporter’s existing conventions:

  • no additional identity labels (instance/job are used instead)
  • value is constant (1)
  • probe succeeds even if location data is not configured

Implementation notes

  • Uses /api/v2/cmdb/system/global
  • Handles both object and array forms of the results field
  • Enabled by default, disabled via the probe configuration

Compatibility
Tested against FortiOS versions that expose gui-device-latitude and
gui-device-longitude. On versions where the fields are missing, the
probe returns no metrics but does not fail.

This enables simple geographic visualization of FortiGate devices
without affecting existing dashboards or metrics.

Add a new probe that retrieves device latitude and longitude from
/api/v2/cmdb/system/global and exposes them as an info metric:

  fortigate_location_info{latitude, longitude} 1

The probe is best-effort and returns success even when the location
metadata is not configured.

Signed-off-by: Michael Lucka <michael.lucka@rnetx.com>
Signed-off-by: Michael Lucka <michael.lucka@rnetx.com>
@rnxmlu rnxmlu force-pushed the pr-probe-location branch from 7b57ff8 to 69bdd07 Compare February 5, 2026 23:22
Signed-off-by: Michael Lucka <michael.lucka@rnetx.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant