Merge c1feeaec24
into 3f531e59fc
This commit is contained in:
commit
b2bc952c9e
|
@ -4,7 +4,7 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/mdlayher/apcupsd"
|
||||
"github.com/Supporterino/apcupsd"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
|
@ -25,6 +25,7 @@ type UPSCollector struct {
|
|||
LineVolts *prometheus.Desc
|
||||
LineNominalVolts *prometheus.Desc
|
||||
OutputVolts *prometheus.Desc
|
||||
OutputAmps *prometheus.Desc
|
||||
BatteryVolts *prometheus.Desc
|
||||
BatteryNominalVolts *prometheus.Desc
|
||||
BatteryNumberTransfersTotal *prometheus.Desc
|
||||
|
@ -89,6 +90,13 @@ func NewUPSCollector(ss StatusSource) *UPSCollector {
|
|||
nil,
|
||||
),
|
||||
|
||||
OutputAmps: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, "", "output_amps"),
|
||||
"Current ampere draw on output.",
|
||||
labels,
|
||||
nil,
|
||||
),
|
||||
|
||||
BatteryVolts: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, "", "battery_volts"),
|
||||
"Current UPS battery voltage.",
|
||||
|
@ -180,6 +188,7 @@ func (c *UPSCollector) Describe(ch chan<- *prometheus.Desc) {
|
|||
c.LineVolts,
|
||||
c.LineNominalVolts,
|
||||
c.OutputVolts,
|
||||
c.OutputAmps,
|
||||
c.BatteryVolts,
|
||||
c.BatteryNominalVolts,
|
||||
c.BatteryNumberTransfersTotal,
|
||||
|
@ -250,6 +259,13 @@ func (c *UPSCollector) Collect(ch chan<- prometheus.Metric) {
|
|||
s.UPSName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.OutputAmps,
|
||||
prometheus.GaugeValue,
|
||||
s.OutputAmps,
|
||||
s.UPSName,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.BatteryVolts,
|
||||
prometheus.GaugeValue,
|
||||
|
|
Loading…
Reference in New Issue