Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/scollector: Collect ifspeed metric and master metadata for linux teams #1377

Merged
merged 1 commit into from
Oct 5, 2015
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