Skip to content

Commit 2057a93

Browse files
committed
Merge branch 'feature/sandbox-information' of github.com:Philldomd/fortigate_exporter into feature/sandbox-information
2 parents fd4d0fa + b97b9ca commit 2057a93

File tree

97 files changed

+2411
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2411
-412
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
thread: [ 0, 1, 2 ]
2323
steps:
24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
2626
- uses: ./.github/promci/actions/build
2727
with:
@@ -40,7 +40,7 @@ jobs:
4040
matrix:
4141
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
4242
steps:
43-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4444
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
4545
- uses: ./.github/promci/actions/build
4646
with:
@@ -51,9 +51,9 @@ jobs:
5151
name: Verify
5252
runs-on: ubuntu-latest
5353
container:
54-
image: quay.io/prometheus/golang-builder:1.23-base
54+
image: quay.io/prometheus/golang-builder:1.25-base
5555
steps:
56-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
56+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5757
- run: make build
5858
- name: Verify example configs
5959
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
@@ -63,11 +63,11 @@ jobs:
6363
runs-on: ubuntu-latest
6464
needs: [build_all, verify-example-configs]
6565
if: |
66-
(github.repository == 'prometheus-community/fortigate-exporter')
66+
(github.repository == 'prometheus-community/fortigate_exporter')
6767
&&
6868
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
6969
steps:
70-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
70+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7171
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
7272
- uses: ./.github/promci/actions/publish_main
7373
with:
@@ -83,11 +83,11 @@ jobs:
8383
runs-on: ubuntu-latest
8484
needs: [build_all, verify-example-configs]
8585
if: |
86-
(github.repository == 'prometheus-community/fortigate-exporter')
86+
(github.repository == 'prometheus-community/fortigate_exporter')
8787
&&
88-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
88+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
8989
steps:
90-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
90+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9191
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
9292
- uses: ./.github/promci/actions/publish_release
9393
with:

.github/workflows/container_description.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: git checkout
2121
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
persist-credentials: false
2224
- name: Set docker hub repo name
2325
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
2426
- name: Push README to Dockerhub
@@ -41,6 +43,8 @@ jobs:
4143
steps:
4244
- name: git checkout
4345
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
persist-credentials: false
4448
- name: Set quay.io org name
4549
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
4650
- name: Set quay.io repo name

.github/workflows/golangci-lint.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@ jobs:
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2830
- name: Install Go
29-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
31+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3032
with:
31-
go-version: 1.23.x
33+
go-version: 1.25.x
3234
- name: Install snmp_exporter/generator dependencies
3335
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3436
if: github.repository == 'prometheus/snmp_exporter'
37+
- name: Get golangci-lint version
38+
id: golangci-lint-version
39+
run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT
3540
- name: Lint
36-
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
41+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
3742
with:
3843
args: --verbose
39-
version: v1.63.4
44+
version: ${{ steps.golangci-lint-version.outputs.version }}

.golangci.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
---
1+
version: "2"
22
linters:
33
enable:
44
- misspell
5+
- modernize
6+
- revive
57
- sloglint
6-
7-
issues:
8-
exclude-rules:
9-
- path: _test.go
10-
linters:
11-
- errcheck
8+
exclusions:
9+
generated: lax
10+
presets:
11+
- comments
12+
- common-false-positives
13+
- legacy
14+
- std-error-handling
15+
rules:
16+
- linters:
17+
- errcheck
18+
path: _test.go
19+
formatters:
20+
enable:
21+
- gci
22+
- gofumpt
23+
- goimports
24+
exclusions:
25+
generated: lax
26+
settings:
27+
gci:
28+
sections:
29+
- standard
30+
- default
31+
- prefix(github.com/prometheus-community/fortigate_exporter)
32+
gofumpt:
33+
extra-rules: true
34+
goimports:
35+
local-prefixes:
36+
- github.com/prometheus-community/fortigate_exporter

.promu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
go:
22
# This must match .circle/config.yml.
3-
version: 1.23
3+
version: 1.25
44
repository:
55
path: github.com/prometheus-community/fortigate_exporter
66
build:

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Prometheus Community Code of Conduct
2+
3+
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 The Prometheus Authors
1+
# Copyright The Prometheus Authors
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

Makefile.common

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.63.4
64+
GOLANGCI_LINT_VERSION ?= v2.6.0
65+
GOLANGCI_FMT_OPTS ?=
6566
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6667
# windows isn't included here because of the path separator being different.
6768
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
@@ -138,7 +139,7 @@ common-deps:
138139
update-go-deps:
139140
@echo ">> updating Go dependencies"
140141
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
141-
$(GO) get -d $$m; \
142+
$(GO) get $$m; \
142143
done
143144
$(GO) mod tidy
144145

@@ -156,9 +157,13 @@ $(GOTEST_DIR):
156157
@mkdir -p $@
157158

158159
.PHONY: common-format
159-
common-format:
160+
common-format: $(GOLANGCI_LINT)
160161
@echo ">> formatting code"
161162
$(GO) fmt $(pkgs)
163+
ifdef GOLANGCI_LINT
164+
@echo ">> formatting code with golangci-lint"
165+
$(GOLANGCI_LINT) fmt $(GOLANGCI_FMT_OPTS)
166+
endif
162167

163168
.PHONY: common-vet
164169
common-vet:
@@ -248,8 +253,8 @@ $(PROMU):
248253
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
249254
rm -r $(PROMU_TMP)
250255

251-
.PHONY: proto
252-
proto:
256+
.PHONY: common-proto
257+
common-proto:
253258
@echo ">> generating code from proto files"
254259
@./scripts/genproto.sh
255260

@@ -261,6 +266,10 @@ $(GOLANGCI_LINT):
261266
| sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION)
262267
endif
263268

269+
.PHONY: common-print-golangci-lint-version
270+
common-print-golangci-lint-version:
271+
@echo $(GOLANGCI_LINT_VERSION)
272+
264273
.PHONY: precheck
265274
precheck::
266275

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ Supported metrics right now as follows.
3838
Global:
3939

4040
* _System/SensorInfo_
41+
* `fortigate_sensor_alarm_status`
4142
* `fortigate_sensor_fan_rpm`
4243
* `fortigate_sensor_temperature_celsius`
4344
* `fortigate_sensor_voltage_volts`
45+
* `fortigate_sensor_thresholds`
4446
* _System/Status_
4547
* `fortigate_version_info`
48+
* _System/Transceivers_
49+
* `fortigate_interface_transceivers`
4650
* _System/Time/Clock_
4751
* `fortigate_time_seconds`
4852
* _System/Resource/Usage_
@@ -51,6 +55,14 @@ Global:
5155
* `fortigate_current_sessions`
5256
* _System/HAChecksums_
5357
* `fortigate_ha_member_has_role`
58+
* _System/Ntp/Status_
59+
* `fortigate_system_ntp_delay_seconds`
60+
* `fortigate_system_ntp_dispersion_seconds`
61+
* `fortigate_system_ntp_dispersion_peer_seconds`
62+
* `fortigate_system_ntp_expires_seconds`
63+
* `fortigate_system_ntp_offset_seconds`
64+
* `fortigate_system_ntp_reftime_seconds`
65+
* `fortigate_system_ntp_stratum`
5466
* _License/Status_
5567
* `fortigate_license_vdom_usage`
5668
* `fortigate_license_vdom_max`
@@ -69,7 +81,7 @@ Global:
6981

7082
Per-VDOM:
7183

72-
* _System/VDOMResources_
84+
* _System/Resource/Usage/VDOM_
7385
* `fortigate_vdom_cpu_usage_ratio`
7486
* `fortigate_vdom_memory_usage_ratio`
7587
* `fortigate_vdom_current_sessions`
@@ -98,9 +110,26 @@ Per-VDOM:
98110
* `fortigate_interface_receive_bytes_total`
99111
* `fortigate_interface_transmit_errors_total`
100112
* `fortigate_interface_receive_errors_total`
113+
* _System/Interface/Transceivers_
114+
* `fortigate_inteface_transceivers_info`
101115
* _System/SDNConnector_
102116
* `fortigate_system_sdn_connector_status`
103117
* `fortigate_system_sdn_connector_last_update_seconds`
118+
* _System/VDOMResource_
119+
* `fortigate_vdom_resource_cpu_usage`
120+
* `fortigate_vdom_resource_memory_usage`
121+
* `fortigate_vdom_resource_setup_rate`
122+
* `fortigate_vdom_resource_deletable`
123+
* `fortigate_vdom_resource_object_id`
124+
* `fortigate_vdom_resource_object_custom_max`
125+
* `fortigate_vdom_resource_object_custom_min_value`
126+
* `fortigate_vdom_resource_object_custom_max_value`
127+
* `fortigate_vdom_resource_object_guaranted`
128+
* `fortigate_vdom_resource_object_guaranted_max_value`
129+
* `fortigate_vdom_resource_object_guaranted_min_value`
130+
* `fortigate_vdom_resource_object_global_max`
131+
* `fortigate_vdom_resource_object_current_usage`
132+
* `fortigate_vdom_resource_object_usage_percentage`
104133
* _User/Fsso_
105134
* `fortigate_user_fsso_info`
106135
* _VPN/Ssl/Connections_
@@ -424,15 +453,18 @@ To improve security, limit permissions to required ones only (least privilege pr
424453
|System/Fortimanager/Status | sysgrp.cfg |api/v2/monitor/system/fortimanager/status |
425454
|System/HAStatistics | sysgrp.cfg |api/v2/monitor/system/ha-statistics<br>api/v2/cmdb/system/ha |
426455
|System/Interface | netgrp.cfg |api/v2/monitor/system/interface/select |
456+
|System/Interface/Transceivers| *any* |api/v2/monitor/system/interface/transceivers |
427457
|System/LinkMonitor | sysgrp.cfg |api/v2/monitor/system/link-monitor |
458+
|System/Ntp/Status | netgrp.cfg |api/v2/monitor/system/ntp/status |
428459
|System/Resource/Usage | sysgrp.cfg |api/v2/monitor/system/resource/usage |
460+
|System/Resource/Usage/VDOM | sysgrp.cfg |api/v2/monitor/system/resource/usage |
429461
|System/SensorInfo | sysgrp.cfg |api/v2/monitor/system/sensor-info |
430462
|System/Status | *any* |api/v2/monitor/system/status |
431463
|System/Sandbox/Connection | sysgrp.cfg |api/v2/monitor/system/sandbox/connection|
432464
|System/Sandbox/Status | sysgrp.cfg |api/v2/monitor/system/sandbox/status|
433465
|System/Sandbox/Stats | sysgrp.cfg |api/v2/monitor/system/sandbox/stats|
434466
|System/Time/Clock | sysgrp.cfg |api/v2/monitor/system/time |
435-
|System/VDOMResources | sysgrp.cfg |api/v2/monitor/system/resource/usage |
467+
|System/System/VDOMResource | sysgrp.cfg |api/v2/monitor/system/vdom-resource |
436468
|User/Fsso | authgrp |api/v2/monitor/user/fsso |
437469
|VPN/IPSec | vpngrp |api/v2/monitor/vpn/ipsec |
438470
|VPN/Ssl/Connections | vpngrp |api/v2/monitor/vpn/ssl |

SECURITY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reporting a security issue
2+
3+
The Prometheus security policy, including how to report vulnerabilities, can be
4+
found here:
5+
6+
<https://prometheus.io/docs/operating/security/>

0 commit comments

Comments
 (0)