AnalogJ / scrutiny

Hard Drive S.M.A.R.T Monitoring, Historical Trends & Real World Failure Thresholds
MIT License
4.72k stars 154 forks source link

[FEAT] Remove the temperature graph #583

Open zuavra opened 4 months ago

zuavra commented 4 months ago

May I suggest killing the temperature graph altogether? It's of limited use and has lots of bugs logged against it.

Since scrutiny logs to influxdb and it's trivial to connect that to grafana, you can make much more interesting widgets and graphs that way, based on the full range of attributes.

IMHO Scrutiny should focus on what it does best – logging SMART data, massaging it for human consumption, and presenting it in terms of Backblaze failure probability – but delegate fancy graphical representations of the data to projects that focus on that.

SaraDark commented 4 months ago

An option to turn on/off the temperature graph would be ok :)

zuavra commented 3 months ago

FWIW InfluxDB2 also comes with the ability to make graphs and dashboards so you might not even need Grafana.

This will give you the equivalent of the temperature graph:

from(bucket: "metrics")
  |> range(start: -15d)
  |> filter(fn: (r) => r["_field"] == "attr.194.transformed_value")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

This is an example of plotting a single attribute (keeping an eye on attribute 188, Command Timeout):

from(bucket: "metrics")
  |> range(start: -15d)
  |> filter(fn: (r) => r["_field"] == "attr.188.transformed_value")
  |> group(columns: ["device_wwn"])
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

This is an example of plotting multiple "bad" attributes (5, 197, 198) to see if any of them deviates from zero:

from(bucket: "metrics")
  |> range(start: -15d)
  |> filter(fn: (r) => r["_field"] == "attr.197.transformed_value" or r["_field"] == "attr.198.transformed_value" or r["_field"] == "attr.5.transformed_value")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

Hope this helps somebody.