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
219ecea4
Commit
219ecea4
authored
Nov 17, 2017
by
Fulvio Galeazzi
Browse files
2017-11-17: FG; Added full and near-full thresholds.
parent
647dcd0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Ceph/Config/userparameter_ceph.conf
View file @
219ecea4
...
...
@@ -11,6 +11,8 @@ UserParameter=ceph.global.slowosd[*],/etc/zabbix/scripts/cephHealth.pl $1 --slow
UserParameter
=
ceph
.
global
.
slowreq
[*],/
etc
/
zabbix
/
scripts
/
cephHealth
.
pl
$
1
--
slowreq
UserParameter
=
ceph
.
osd
.
nearfull
[*],/
etc
/
zabbix
/
scripts
/
cephHealth
.
pl
$
1
--
nearfull
UserParameter
=
ceph
.
osd
.
full
[*],/
etc
/
zabbix
/
scripts
/
cephHealth
.
pl
$
1
--
full
UserParameter
=
ceph
.
osd
.
thrnearfull
[*],/
etc
/
zabbix
/
scripts
/
cephHealth
.
pl
$
1
--
nearfullth
UserParameter
=
ceph
.
osd
.
thrfull
[*],/
etc
/
zabbix
/
scripts
/
cephHealth
.
pl
$
1
--
fullth
UserParameter
=
ceph
.
osd
.
down
[*],/
etc
/
zabbix
/
scripts
/
cephOsdStat
.
pl
$
1
-
s
down
UserParameter
=
ceph
.
osd
.
up
[*],/
etc
/
zabbix
/
scripts
/
cephOsdStat
.
pl
$
1
-
s
up
UserParameter
=
ceph
.
osd
.
out
[*],/
etc
/
zabbix
/
scripts
/
cephOsdStat
.
pl
$
1
-
s
out
...
...
Ceph/Script/cephHealth.pl
View file @
219ecea4
...
...
@@ -71,7 +71,7 @@ chomp $_sudo;
### Options
our
(
$opt_exec
,
$opt_become
,
$opt_cluster
,
$opt_user
,
$opt_keyring
,
$opt_monhost
,
$opt_status
,
$opt_slow_osd
,
$opt_slow_req
,
$opt_object_degraded
,
$opt_object_misplaced
,
$opt_fraction
,
$opt_full
,
$opt_nearfull
,
$opt_filter
,
$opt_debug
,
$opt_h
);
$opt_fraction
,
$opt_fullth
,
$opt_nearfullth
,
$opt_full
,
$opt_nearfull
,
$opt_filter
,
$opt_debug
,
$opt_h
);
if
(
@ARGV
>
0
)
{
GetOptions
("
e=s
"
=>\
$opt_exec
,
"
b
"
=>\
$opt_become
,
...
...
@@ -85,6 +85,8 @@ if (@ARGV > 0) {
"
od
"
=>\
$opt_object_degraded
,
"
om
"
=>\
$opt_object_misplaced
,
"
f
"
=>\
$opt_fraction
,
"
fullth
"
=>\
$opt_fullth
,
"
nearfullth
"
=>\
$opt_nearfullth
,
"
full
"
=>\
$opt_full
,
"
nearfull
"
=>\
$opt_nearfull
,
"
s=s
"
=>\
$opt_filter
,
...
...
@@ -150,14 +152,45 @@ my $doOsdNearFull = 0;
if
(
defined
$opt_nearfull
)
{
$doOsdNearFull
=
1
;
}
my
$doOsdFullth
=
0
;
if
(
defined
$opt_fullth
)
{
$doOsdFullth
=
1
;
}
my
$doOsdNearFullth
=
0
;
if
(
defined
$opt_nearfullth
)
{
$doOsdNearFullth
=
1
;
}
my
@matchStr
=
();
if
(
defined
$opt_filter
)
{
@matchStr
=
split
(
/,/
,
$opt_filter
);
}
#
my
$sumDo
=
$doStatus
+
$doSlowOsd
+
$doSlowReq
+
$doObjectDeg
+
$doObjectMis
+
$doOsdFull
+
$doOsdNearFull
;
my
$sumDo
=
$doStatus
+
$doSlowOsd
+
$doSlowReq
+
$doObjectDeg
+
$doObjectMis
+
$doOsdFull
+
$doOsdNearFull
+
$doOsdFullth
+
$doOsdNearFullth
;
if
(
$sumDo
>
1
)
{
fail_usage
"
Either status or slow_requests/osds or objectsDeg/objectsMis or OSD_full/OSD_nearfull.
";
fail_usage
"
Either status or slow_requests/osds or objectsDeg/objectsMis or OSD_full/OSD_nearfull or OSD_fullTh/OSD_nearfullTh.
";
}
# Fetch the "pg dump" data and put it in an array
if
(
$doOsdFullth
+
$doOsdNearFullth
)
{
my
@_pgdata
=
`
$cephCmd
pg dump 2> /dev/null
`;
chomp
@_pgdata
;
foreach
my
$_pgline
(
@_pgdata
)
{
if
(
$doOsdFullth
)
{
if
(
$_pgline
=~
m/^full\S+\s+([-+]?[0-9]*\.?[0-9]+)/
)
{
print
$
1
.
"
\n
";
exit
0
;
}
}
elsif
(
$doOsdNearFullth
)
{
if
(
$_pgline
=~
m/^nearfull\S+\s+([-+]?[0-9]*\.?[0-9]+)/
)
{
print
$
1
.
"
\n
";
exit
0
;
}
}
if
(
$_pgline
=~
m/^\d+/
)
{
print
"
-1
"
.
"
\n
";
exit
0
;
}
}
}
# Fetch the data and put it in an array
...
...
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