@@ -25,7 +25,7 @@ func probeSystemHaPeer (c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Me
2525 var (
2626 Priority = prometheus .NewDesc (
2727 "fortigate_ha_peer" ,
28- "True when the peer device is the HA primary.(true=1, false=0) " ,
28+ "True when the peer device is the HA primary." ,
2929 []string {"serial" ,"vcluster" ,"hostname" ,"master" ,"primary" ,"priority" }, nil ,
3030 )
3131 )
@@ -52,9 +52,11 @@ func probeSystemHaPeer (c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Me
5252 for _ , r := range res .Result {
5353 if meta .VersionMajor >= 7 && meta .VersionMinor >= 4 {
5454 if (r .Primary ) {
55- m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 1 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), strconv .FormatBool (r .Primary ), strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
55+ m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 1 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), "true" , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
56+ m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 0 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), "false" , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
5657 } else {
57- m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 0 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), strconv .FormatBool (r .Primary ), strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
58+ m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 0 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), "true" , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
59+ m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , 1 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatBool (r .Master ), "false" , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
5860 }
5961 } else {
6062 m = append (m , prometheus .MustNewConstMetric (Priority , prometheus .GaugeValue , - 1 , "None" , "0" , "None" , "false" , "Unsupported" , "false" ))
0 commit comments