Skip to content

Commit 55df8e4

Browse files
committed
Removed year in copyright, removed public variables
Signed-off-by: Örnfeldt Philip (66140321) <[email protected]>
1 parent 1f7702b commit 55df8e4

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

metrics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Global:
3838
* _System/HAChecksums_
3939
* `fortigate_ha_member_has_role`
4040
* _System/HAPeer_
41-
* `fortigate_ha_peer`
41+
* `fortigate_ha_peer_info`
42+
* `fortigate_ha_peer_primary`
4243
* _System/Ntp/Status_
4344
* `fortigate_system_ntp_delay_seconds`
4445
* `fortigate_system_ntp_dispersion_seconds`

pkg/probe/system_ha_peer.go

Lines changed: 7 additions & 7 deletions
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
@@ -23,13 +23,13 @@ import (
2323
)
2424

2525
func probeSystemHaPeer(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
26-
Info := prometheus.NewDesc(
26+
info := prometheus.NewDesc(
2727
"fortigate_ha_peer_info",
2828
"Information about the ha peer.",
2929
[]string{"serial", "vcluster", "hostname", "priority"}, nil,
3030
)
3131

32-
Primary := prometheus.NewDesc(
32+
primary := prometheus.NewDesc(
3333
"fortigate_ha_peer_primary",
3434
"True when the peer device is the HA primary.",
3535
[]string{"vcluster", "hostname"}, nil,
@@ -56,14 +56,14 @@ func probeSystemHaPeer(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Met
5656
m := []prometheus.Metric{}
5757
for _, r := range res.Result {
5858
if meta.VersionMajor >= 7 && meta.VersionMinor >= 4 {
59-
m = append(m, prometheus.MustNewConstMetric(Info, prometheus.GaugeValue, 1, r.Serial, strconv.FormatInt(r.Vcluster, 10), r.Hostname, strconv.FormatFloat(r.Priority, 'f', -1, 64)))
59+
m = append(m, prometheus.MustNewConstMetric(info, prometheus.GaugeValue, 1, r.Serial, strconv.FormatInt(r.Vcluster, 10), r.Hostname, strconv.FormatFloat(r.Priority, 'f', -1, 64)))
6060
if r.Primary {
61-
m = append(m, prometheus.MustNewConstMetric(Primary, prometheus.GaugeValue, 1, strconv.FormatInt(r.Vcluster, 10), r.Hostname))
61+
m = append(m, prometheus.MustNewConstMetric(primary, prometheus.GaugeValue, 1, strconv.FormatInt(r.Vcluster, 10), r.Hostname))
6262
} else {
63-
m = append(m, prometheus.MustNewConstMetric(Primary, prometheus.GaugeValue, 0, strconv.FormatInt(r.Vcluster, 10), r.Hostname))
63+
m = append(m, prometheus.MustNewConstMetric(primary, prometheus.GaugeValue, 0, strconv.FormatInt(r.Vcluster, 10), r.Hostname))
6464
}
6565
} else {
66-
m = append(m, prometheus.MustNewConstMetric(Info, prometheus.GaugeValue, -1, "None", "0", "None", "false"))
66+
m = append(m, prometheus.MustNewConstMetric(info, prometheus.GaugeValue, -1, "None", "0", "None", "false"))
6767
break
6868
}
6969
}

pkg/probe/system_ha_peer_test.go

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

0 commit comments

Comments
 (0)