Révision 32b4df0c
added ceph_capacity and ceph_osd
| plugins/ceph/ceph_capacity | ||
|---|---|---|
| 1 |
#!/bin/sh |
|
| 2 |
|
|
| 3 |
: << =cut |
|
| 4 |
|
|
| 5 |
=head1 NAME |
|
| 6 |
|
|
| 7 |
ceph_capacity - Shows ceph total storage capacity, used raw space and used data space |
|
| 8 |
|
|
| 9 |
=head1 CONFIGURATION |
|
| 10 |
|
|
| 11 |
[ceph_capacity] |
|
| 12 |
env.warning_level Used raw space percentage above warning alert should be issued |
|
| 13 |
env.critical_level Used raw space percentage above critical alert should be issued |
|
| 14 |
|
|
| 15 |
=head1 AUTHOR |
|
| 16 |
|
|
| 17 |
Mate Gabri <mate@gabri.hu> |
|
| 18 |
|
|
| 19 |
=head1 LICENSE |
|
| 20 |
|
|
| 21 |
GPLv2 |
|
| 22 |
|
|
| 23 |
=head1 MAGICK MARKERS |
|
| 24 |
|
|
| 25 |
#%# family=auto |
|
| 26 |
#%# capabilities=autoconf |
|
| 27 |
|
|
| 28 |
=cut |
|
| 29 |
|
|
| 30 |
if [ "$1" = "autoconf" ]; then |
|
| 31 |
echo yes |
|
| 32 |
exit 0 |
|
| 33 |
fi |
|
| 34 |
|
|
| 35 |
WARNING_LEVEL=${warning_level:-"80"}
|
|
| 36 |
CRITICAL_LEVEL=${critical_level:-"90"}
|
|
| 37 |
|
|
| 38 |
if [ "$1" = "config" ]; then |
|
| 39 |
|
|
| 40 |
echo 'graph_title CEPH capacity' |
|
| 41 |
echo 'graph_category ceph' |
|
| 42 |
echo 'graph_vlabel GB' |
|
| 43 |
echo 'graph_info CEPH cluster capacity' |
|
| 44 |
echo 'graph_args --base 1000 -l 0' |
|
| 45 |
|
|
| 46 |
CAPACITY=$(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 3 | cut -d '/' -f 2 | awk '{ print $1 }')
|
|
| 47 |
WARNING=$(echo "scale=2;$CAPACITY * ($WARNING_LEVEL/100)" | bc -l | cut -d '.' -f 1) |
|
| 48 |
CRITICAL=$(echo "scale=2;$CAPACITY * ($CRITICAL_LEVEL/100)" | bc -l | cut -d '.' -f 1) |
|
| 49 |
echo "capacity.label Capacity" |
|
| 50 |
echo "used.label Raw used" |
|
| 51 |
echo "used.draw AREA" |
|
| 52 |
echo "used.warning $WARNING" |
|
| 53 |
echo "used.critical $CRITICAL" |
|
| 54 |
echo "data.label Data" |
|
| 55 |
echo "data.draw AREA" |
|
| 56 |
|
|
| 57 |
exit 0 |
|
| 58 |
fi |
|
| 59 |
|
|
| 60 |
echo "capacity.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 3 | cut -d '/' -f 2 | awk '{ print $1 }')"
|
|
| 61 |
echo "used.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 2 | awk '{ print $1 }')"
|
|
| 62 |
echo "data.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 1 | awk '{ print $1 }')"
|
|
| plugins/ceph/ceph_osd | ||
|---|---|---|
| 1 |
#!/bin/sh |
|
| 2 |
|
|
| 3 |
: << =cut |
|
| 4 |
|
|
| 5 |
=head1 NAME |
|
| 6 |
|
|
| 7 |
ceph_osd - Shows ceph OSD states (total configured, up and in) |
|
| 8 |
|
|
| 9 |
=head1 AUTHOR |
|
| 10 |
|
|
| 11 |
Mate Gabri <mate@gabri.hu> |
|
| 12 |
|
|
| 13 |
=head1 LICENSE |
|
| 14 |
|
|
| 15 |
GPLv2 |
|
| 16 |
|
|
| 17 |
=head1 MAGICK MARKERS |
|
| 18 |
|
|
| 19 |
#%# family=auto |
|
| 20 |
#%# capabilities=autoconf |
|
| 21 |
|
|
| 22 |
=cut |
|
| 23 |
|
|
| 24 |
if [ "$1" = "autoconf" ]; then |
|
| 25 |
echo yes |
|
| 26 |
exit 0 |
|
| 27 |
fi |
|
| 28 |
|
|
| 29 |
|
|
| 30 |
if [ "$1" = "config" ]; then |
|
| 31 |
|
|
| 32 |
echo 'graph_title CEPH OSDs' |
|
| 33 |
echo 'graph_category ceph' |
|
| 34 |
echo 'graph_vlabel nr' |
|
| 35 |
echo 'graph_info CEPH OSD up/down status' |
|
| 36 |
echo 'graph_scale no' |
|
| 37 |
echo 'graph_args --base 1000 -l 0' |
|
| 38 |
|
|
| 39 |
echo "osds.label OSDs" |
|
| 40 |
echo "up.label Up" |
|
| 41 |
echo "in.label In" |
|
| 42 |
echo "in.draw AREA" |
|
| 43 |
|
|
| 44 |
exit 0 |
|
| 45 |
fi |
|
| 46 |
|
|
| 47 |
echo "osds.value $(ceph -s | grep osdmap | awk '{ print $3 }')"
|
|
| 48 |
echo "up.value $(ceph -s | grep osdmap | awk '{ print $5 }')"
|
|
| 49 |
echo "in.value $(ceph -s | grep osdmap | awk '{ print $7 }')"
|
|
Formats disponibles : Unified diff