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
bef265d2
Commit
bef265d2
authored
3 years ago
by
Sergey Ivanov
Browse files
Options
Downloads
Patches
Plain Diff
more fixes
parent
e4373a5f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Site/ZpoolScrub.pm
+32
-24
32 additions, 24 deletions
lib/Site/ZpoolScrub.pm
with
32 additions
and
24 deletions
lib/Site/ZpoolScrub.pm
+
32
−
24
View file @
bef265d2
...
...
@@ -86,26 +86,6 @@ sub handler {
my
$oldhowlong
=
(
(
-
r
$statusfile
)
?
`
cat
$statusfile
`
:
0
);
chomp
$oldhowlong
;
$oldhowlong
=
0
unless
$oldhowlong
=~
/^[\d]+$/
;
=pod
scan: scrub repaired 0 in 78h6m with 0 errors on Tue Mar 29 00:16:48 2016
- or -
scan: scrub repaired 0B in 0 days 09:55:51 with 0 errors on Thu Mar 7 01:46:05 2019
- or -
scan: scrub repaired 0B in 14:02:48 with 0 errors on Fri Oct 1 16:02:50 2021
- or -
scan: scrub in progress since Tue Mar 29 19:09:47 2016
14.3G scanned out of 47.0G at 172M/s, 0h3m to go
0 repaired, 30.42% done
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
451G scanned at 2.17G/s, 2.13M issued at 10.5K/s, 19.6T total
0B resilvered, 0.00% done, no estimated completion time
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
855G scanned at 188M/s, 227G issued at 49.9M/s, 19.6T total
228G resilvered, 1.13% done, 4 days 17:00:28 to go
=cut
my
(
$when
,
$days
,
$h
,
$m
,
$s
,
$howlong
,
$togo
,
$repaired
,
$errors
,
$canceled
)
=
(
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
my
$STATUSCMD
=
"
/usr/sbin/zpool status
$zpool
";
...
...
@@ -122,6 +102,9 @@ sub handler {
$errors
=
0
;
$canceled
=
1
;
}
=pod
scan: scrub repaired 0B in 0 days 09:55:51 with 0 errors on Thu Mar 7 01:46:05 2019
=cut
elsif
(
/^\s*scan:\s+scrub\s+repaired\s+(\d*B*)\D*\s+in\s+(\d*)\s+days\s+(\d*):(\d*):(\d*)\s+with\s+(\d*)\s+errors\s+on\s+(.+)$/
){
(
$repaired
,
$days
,
$h
,
$m
,
$s
,
$errors
,
$when
)
=
(
$
1
,
$
2
,
$
3
,
$
4
,
$
5
,
$
6
,
$
7
);
$when
=
`
$DATE
'+%s'
`
-
`
$DATE
'+%s' -d "
$when
"
`;
...
...
@@ -129,6 +112,11 @@ sub handler {
$when
+=
60
*$howlong
;
$repaired
+=
$errors
if
$repaired
<
$errors
;
}
=pod
scan: scrub repaired 0 in 78h6m with 0 errors on Tue Mar 29 00:16:48 2016
- or -
scan: scrub repaired 0B in 14:02:48 with 0 errors on Fri Oct 1 16:02:50 2021
=cut
elsif
(
/^\s*scan:\s+scrub\s+repaired\s+(\d*B*)\s+in\s+(\d*)[h\:](\d*)[m\:](\d*)\s+with\s+(\d*)\s+errors\s+on\s+(.+)$/
){
(
$repaired
,
$h
,
$m
,
$s
,
$errors
,
$when
)
=
(
$
1
,
$
2
,
$
3
,
$
4
,
$
5
,
$
6
);
$when
=
`
$DATE
'+%s'
`
-
`
$DATE
'+%s' -d "
$when
"
`;
...
...
@@ -148,18 +136,38 @@ sub handler {
$when
/=
60
;
$when
=
int
(
$when
);
}
elsif
(
(
/^\s*\S+B*\s+scanned.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/
)
or
(
/^\s*\S+B*\s+resilvered.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/
)
=pod
14.3G scanned out of 47.0G at 172M/s, 0h3m to go
0 repaired, 30.42% done
- or -
855G scanned at 188M/s, 227G issued at 49.9M/s, 19.6T total
228G resilvered, 1.13% done, 4 days 17:00:28 to go
- or -
6.64T scanned at 45.7M/s, 5.62T issued at 38.7M/s, 11.4T total
0B repaired, 49.49% done, 1 days 19:09:46 to go
=cut
elsif
(
(
/^\s*\S+\s+scanned.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/
)
or
(
/^\s*\S+\s+resilvered.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/
)
or
(
/^\s*\S+\s+repaired.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/
)
){
$togo
=
$
1
*
60
+
$
2
;
$howlong
=
$oldhowlong
;
}
elsif
(
(
/^\s*\S+B*\s+scanned.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/
)
or
(
/^\s*\S+B*\s+resilvered.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/
)
elsif
(
(
/^\s*\S+\s+scanned.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/
)
or
(
/^\s*\S+\s+resilvered.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/
)
or
(
/^\s*\S+\s+repaired.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/
)
){
$togo
=
(
$
1
*
24
+
$
2
)
*
60
+
$
3
;
$howlong
=
$oldhowlong
;
}
=pod
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
451G scanned at 2.17G/s, 2.13M issued at 10.5K/s, 19.6T total
0B resilvered, 0.00% done, no estimated completion time
=cut
elsif
(
(
/^\s*(\d+B*)\s+repaired,/
)
or
(
/^\s*(\d+B*)\s+resilvered,/
)
){
...
...
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