Skip to content

Commit a4d3d24

Browse files
author
Your Name
committed
reading cntlid from the procfs library
Signed-off-by: Your Name <[email protected]>
1 parent bbf86ac commit a4d3d24

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

collector/nvme_linux.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ func (c *nvmeCollector) Update(ch chan<- prometheus.Metric) error {
114114
infoValue := 1.0
115115

116116
devicePath := filepath.Join(*sysPath, "class/nvme", device.Name)
117-
cntlid, err := readUintFromFile(filepath.Join(devicePath, "cntlid"))
118-
if err != nil {
119-
c.logger.Debug("failed to read cntlid", "device", device.Name, "err", err)
120-
}
121-
ch <- prometheus.MustNewConstMetric(c.info, prometheus.GaugeValue, infoValue, device.Name, device.FirmwareRevision, device.Model, device.Serial, device.State, strconv.FormatUint(cntlid, 10))
117+
ch <- prometheus.MustNewConstMetric(c.info, prometheus.GaugeValue, infoValue, device.Name, device.FirmwareRevision, device.Model, device.Serial, device.State, device.ControllerID)
122118
// Find namespace directories.
123119
namespacePaths, err := filepath.Glob(filepath.Join(devicePath, "nvme[0-9]*c[0-9]*n[0-9]*"))
124120
if err != nil {

0 commit comments

Comments
 (0)