-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fire SmartHealthStatusFail only for physical devices #378
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,10 @@ groups: | |
LABELS = {{ $labels }} | ||
|
||
- alert: SmartHealthStatusFail | ||
expr: smartctl_device_smart_status == 0 | ||
# We can check if the physical size of the drive is 0, meaning it's a logical device, | ||
# and ignore the status 0, which is always returned for logical devices, like HW RAID, | ||
# avoiding false positives. | ||
expr: (smartctl_device_smart_status == 0) and on(device, juju_unit) (smartctl_device_block_size{blocks_type="physical"} != 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it necessary to filter by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that way it's more explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if you understood my question. I don't know exactly how many block_types that exists on smartctl, let's say that we have:
With this query we are just joining when |
||
for: 2m | ||
labels: | ||
severity: critical | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking):
It will be more nice if you can provide some information as comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I think there is an incorrect assumption here re: "physical" versus "logical" block size.
I tested this on my local machine. I have an NVME, and it does show up in SMART. It doesn't return a physical block size, but only a logical block size, via smartctl.
There is also the concept of logical block sizes on disks.
That is, this likely does not have to do with whether a device is a "real" physical device or a simulated device like a VM disk, but rather with those technical disk parameters.
I installed prometheus on my laptop and did a quick check against its NVME; this is what I see:
As written, this check will miss any disks - physical disks - which do not report a physical block size but only a logical one.
Also if you're curious, I poked around the sources of the prometheus plugin and extracted what appears to be the smartctl command it runs to pull the block sizes. This is what I get:
You could try this on your own machine if curious.
TLDR: Unfortunately -1; I think we need a different methodology here.