|
|
|
@ -23,6 +23,7 @@ import (
|
|
|
|
|
"github.com/go-kit/log"
|
|
|
|
|
"github.com/go-kit/log/level"
|
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
|
"github.com/prometheus/node_exporter/collector/utils"
|
|
|
|
|
"github.com/prometheus/procfs/sysfs"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -114,23 +115,36 @@ func (c *fibrechannelCollector) Update(ch chan<- prometheus.Metric) error {
|
|
|
|
|
infoValue := 1.0
|
|
|
|
|
|
|
|
|
|
// First push the Host values
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, host.Name, host.Speed, host.PortState, host.PortType, host.PortID, host.PortName, host.FabricName, host.SymbolicName, host.SupportedClasses, host.SupportedSpeeds, host.DevLossTMO)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, utils.SafeDereference(
|
|
|
|
|
host.Name,
|
|
|
|
|
host.Speed,
|
|
|
|
|
host.PortState,
|
|
|
|
|
host.PortType,
|
|
|
|
|
host.PortID,
|
|
|
|
|
host.PortName,
|
|
|
|
|
host.FabricName,
|
|
|
|
|
host.SymbolicName,
|
|
|
|
|
host.SupportedClasses,
|
|
|
|
|
host.SupportedSpeeds,
|
|
|
|
|
host.DevLossTMO,
|
|
|
|
|
)...)
|
|
|
|
|
|
|
|
|
|
// Then the counters
|
|
|
|
|
c.pushCounter(ch, "dumped_frames_total", host.Counters.DumpedFrames, host.Name)
|
|
|
|
|
c.pushCounter(ch, "error_frames_total", host.Counters.ErrorFrames, host.Name)
|
|
|
|
|
c.pushCounter(ch, "invalid_crc_total", host.Counters.InvalidCRCCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "rx_frames_total", host.Counters.RXFrames, host.Name)
|
|
|
|
|
c.pushCounter(ch, "rx_words_total", host.Counters.RXWords, host.Name)
|
|
|
|
|
c.pushCounter(ch, "tx_frames_total", host.Counters.TXFrames, host.Name)
|
|
|
|
|
c.pushCounter(ch, "tx_words_total", host.Counters.TXWords, host.Name)
|
|
|
|
|
c.pushCounter(ch, "seconds_since_last_reset_total", host.Counters.SecondsSinceLastReset, host.Name)
|
|
|
|
|
c.pushCounter(ch, "invalid_tx_words_total", host.Counters.InvalidTXWordCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "link_failure_total", host.Counters.LinkFailureCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "loss_of_sync_total", host.Counters.LossOfSyncCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "loss_of_signal_total", host.Counters.LossOfSignalCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "nos_total", host.Counters.NosCount, host.Name)
|
|
|
|
|
c.pushCounter(ch, "fcp_packet_aborts_total", host.Counters.FCPPacketAborts, host.Name)
|
|
|
|
|
// Note: `procfs` guarantees these a safe dereference for these counters.
|
|
|
|
|
c.pushCounter(ch, "dumped_frames_total", *host.Counters.DumpedFrames, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "error_frames_total", *host.Counters.ErrorFrames, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "invalid_crc_total", *host.Counters.InvalidCRCCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "rx_frames_total", *host.Counters.RXFrames, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "rx_words_total", *host.Counters.RXWords, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "tx_frames_total", *host.Counters.TXFrames, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "tx_words_total", *host.Counters.TXWords, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "seconds_since_last_reset_total", *host.Counters.SecondsSinceLastReset, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "invalid_tx_words_total", *host.Counters.InvalidTXWordCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "link_failure_total", *host.Counters.LinkFailureCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "loss_of_sync_total", *host.Counters.LossOfSyncCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "loss_of_signal_total", *host.Counters.LossOfSignalCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "nos_total", *host.Counters.NosCount, *host.Name)
|
|
|
|
|
c.pushCounter(ch, "fcp_packet_aborts_total", *host.Counters.FCPPacketAborts, *host.Name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|