Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resmon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrors
resmon
Commits
6a9ea86e
Commit
6a9ea86e
authored
6 years ago
by
Sergey Joseph Ivanov
Browse files
Options
Downloads
Patches
Plain Diff
improve Core::SMART module
parent
59554aa8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Core/SMART.pm
+24
-4
24 additions, 4 deletions
lib/Core/SMART.pm
with
24 additions
and
4 deletions
lib/Core/SMART.pm
+
24
−
4
View file @
6a9ea86e
...
@@ -106,10 +106,30 @@ sub handler {
...
@@ -106,10 +106,30 @@ sub handler {
elsif
(
$line
=~
/^Firmware Version:\s+(.+)$/
)
{
elsif
(
$line
=~
/^Firmware Version:\s+(.+)$/
)
{
$smartdata
->
{"
fw
"}
=
[
$
1
,
"
s
"];
$smartdata
->
{"
fw
"}
=
[
$
1
,
"
s
"];
}
}
# Capture attribute_name, value, raw_value (columns 2,4,10)
# Capture id, attribute_name, threshold, fail, raw_value (columns 1,2,6,7,8)
elsif
(
$line
=~
/^\s*\d+\s(\S+)\s+\S+\s+(\S+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)/
)
{
=pod
$smartdata
->
{"
$1
"}
=
[
$
2
,
"
i
"];
Vendor Specific SMART Attributes with Thresholds:
$smartdata
->
{"
$1_raw
"}
=
[
$
3
,
"
i
"];
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0
2 Throughput_Performance 0x0004 137 137 000 Old_age Offline - 91
3 Spin_Up_Time 0x0007 120 120 024 Pre-fail Always - 317 (Average 313)
Per https://www.backblaze.com/blog/what-smart-stats-indicate-hard-drive-failures/,
we should check attributes:
ATTRIBUTE DESCRIPTION
SMART 5 Reallocated Sectors Count
SMART 187 Reported Uncorrectable Errors
SMART 188 Command Timeout
SMART 197 Current Pending Sector Count
SMART 198 Uncorrectable Sector Count
=cut
elsif
(
(
$line
=~
/^\s*(5|187|188|197|198)\s/
)
&&
(
$line
=~
/^\s*(\d+)\s(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+)/
)
)
{
$smartdata
->
{"
$1_name
"}
=
[
$
2
,
"
s
"];
$smartdata
->
{"
$1_thresh
"}
=
[
$
3
,
"
i
"];
$smartdata
->
{"
$1_whenfailed
"}
=
[
$
4
,
"
s
"];
$smartdata
->
{"
$1_raw
"}
=
[
$
5
,
"
i
"];
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment