Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CSD
public
zabbix-templates
Commits
be56bd15
Commit
be56bd15
authored
Nov 06, 2018
by
Fulvio Galeazzi
Browse files
2018-11-06: FG; Fixed bug when OSD size is zero.
parent
3d32df2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Ceph/Script/cephDiskPerf.pl
View file @
be56bd15
...
@@ -174,14 +174,13 @@ foreach my $_lineS (@_dataSize)
...
@@ -174,14 +174,13 @@ foreach my $_lineS (@_dataSize)
my
$frac
=
$fields
[
7
];
my
$frac
=
$fields
[
7
];
my
$size
=
$fields
[
4
];
my
$size
=
$fields
[
4
];
$size
=~
s/iB$//
;
$size
=~
s/iB$//
;
$size
=~
s/B$//
;
my
$sizeLastChar
=
lc
(
chop
(
$size
));
my
$sizeLastChar
=
lc
(
chop
(
$size
));
if
(
$sizeLastChar
eq
"
t
")
{
if
(
$sizeLastChar
eq
"
t
")
{
$size
=
$size
*
1000
.
;
$size
=
$size
*
1000
.
;
}
elsif
(
$sizeLastChar
eq
"
g
")
{
$size
+=
0
.
;
}
else
{
$size
=
$fields
[
4
];
}
}
$size
+=
0
.
;
push
(
@
{
$dataSizeH
{
$size
}},
$osdNum
);
push
(
@
{
$dataSizeH
{
$size
}},
$osdNum
);
push
(
@
{
$dataTypeH
{
$type
}},
$osdNum
);
push
(
@
{
$dataTypeH
{
$type
}},
$osdNum
);
push
(
@
{
$fracSizeH
{
$size
}},
$frac
);
push
(
@
{
$fracSizeH
{
$size
}},
$frac
);
...
...
Ceph/Script/queryCephDisks.pl
View file @
be56bd15
...
@@ -197,14 +197,13 @@ foreach my $_line (@_data)
...
@@ -197,14 +197,13 @@ foreach my $_line (@_data)
my
$frac
=
$fields
[
7
];
my
$frac
=
$fields
[
7
];
my
$size
=
$fields
[
4
];
my
$size
=
$fields
[
4
];
$size
=~
s/iB$//
;
$size
=~
s/iB$//
;
$size
=~
s/B$//
;
my
$sizeLastChar
=
lc
(
chop
(
$size
));
my
$sizeLastChar
=
lc
(
chop
(
$size
));
if
(
$sizeLastChar
eq
"
t
")
{
if
(
$sizeLastChar
eq
"
t
")
{
$size
=
$size
*
1000
.
;
$size
=
$size
*
1000
.
;
}
elsif
(
$sizeLastChar
eq
"
g
")
{
$size
+=
0
.
;
}
else
{
$size
=
$fields
[
4
];
}
}
$size
+=
0
.
;
next
unless
(
$size
);
next
unless
(
$size
);
push
(
@
{
$dataHash
{
$size
}},
$osdNum
);
push
(
@
{
$dataHash
{
$size
}},
$osdNum
);
push
(
@
{
$typeHash
{
$type
}},
$osdNum
);
push
(
@
{
$typeHash
{
$type
}},
$osdNum
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment