这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion cmd/scollector/collectors/dell_hw.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,41 @@ func c_omreport_storage_pdisk(id string, md *opentsdb.MultiDataPoint) {
}
//Need to find out what the various ID formats might be
id := strings.Replace(fields[0], ":", "_", -1)
Add(md, "hw.storage.pdisk", severity(fields[1]), opentsdb.TagSet{"id": id}, metadata.Gauge, metadata.Ok, descDellHWPDisk)
ts := opentsdb.TagSet{"id": id}
Add(md, "hw.storage.pdisk", severity(fields[1]), ts, metadata.Gauge, metadata.Ok, descDellHWPDisk)
if len(fields) < 32 {
return
}
if fields[2] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic numbers really scare me. How confident are we in this field ordering?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory it is parseable output. Long term I want to pull from the Dracs
on this. So I'm okay with code that is more fragile over long time. With
our integration with Opserver we will find out fast...

On Mon, Oct 5, 2015 at 11:51 AM, Craig Peterson notifications@github.com
wrote:

In cmd/scollector/collectors/dell_hw.go
#1377 (comment):

@@ -149,7 +149,41 @@ func c_omreport_storage_pdisk(id string, md *opentsdb.MultiDataPoint) {
}
//Need to find out what the various ID formats might be
id := strings.Replace(fields[0], ":", "_", -1)

  •   Add(md, "hw.storage.pdisk", severity(fields[1]), opentsdb.TagSet{"id": id}, metadata.Gauge, metadata.Ok, descDellHWPDisk)
    
  •   ts := opentsdb.TagSet{"id": id}
    
  •   Add(md, "hw.storage.pdisk", severity(fields[1]), ts, metadata.Gauge, metadata.Ok, descDellHWPDisk)
    
  •   if len(fields) < 32 {
    
  •       return
    
  •   }
    
  •   if fields[2] != "" {
    

magic numbers really scare me. How confident are we in this field ordering?


Reply to this email directly or view it on GitHub
https://github.com/bosun-monitor/bosun/pull/1377/files#r41160647.

metadata.AddMeta("", ts, "name", fields[2], true)
}
if fields[6] != "" {
metadata.AddMeta("", ts, "media", fields[6], true)
}
if fields[19] != "" {
metadata.AddMeta("", ts, "capacity", fields[19], true)
}
if fields[23] != "" {
metadata.AddMeta("", ts, "vendorId", fields[23], true)
}
if fields[24] != "" {
metadata.AddMeta("", ts, "productId", fields[24], true)
}
if fields[25] != "" {
metadata.AddMeta("", ts, "serial", fields[25], true)
}
if fields[26] != "" {
metadata.AddMeta("", ts, "part", fields[26], true)
}
if fields[27] != "" {
metadata.AddMeta("", ts, "negotatiedSpeed", fields[27], true)
}
if fields[28] != "" {
metadata.AddMeta("", ts, "capableSpeed", fields[28], true)
}
if fields[31] != "" {
metadata.AddMeta("", ts, "sectorSize", fields[31], true)
}
}, "storage", "pdisk", "controller="+id)
}

Expand Down