1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

added ceph_capacity and ceph_osd

This commit is contained in:
GABRI Mate 2013-02-08 12:17:02 +01:00
parent e71641b88f
commit 32b4df0c2d
2 changed files with 111 additions and 0 deletions

62
plugins/ceph/ceph_capacity Executable file
View file

@ -0,0 +1,62 @@
#!/bin/sh
: << =cut
=head1 NAME
ceph_capacity - Shows ceph total storage capacity, used raw space and used data space
=head1 CONFIGURATION
[ceph_capacity]
env.warning_level Used raw space percentage above warning alert should be issued
env.critical_level Used raw space percentage above critical alert should be issued
=head1 AUTHOR
Mate Gabri <mate@gabri.hu>
=head1 LICENSE
GPLv2
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
WARNING_LEVEL=${warning_level:-"80"}
CRITICAL_LEVEL=${critical_level:-"90"}
if [ "$1" = "config" ]; then
echo 'graph_title CEPH capacity'
echo 'graph_category ceph'
echo 'graph_vlabel GB'
echo 'graph_info CEPH cluster capacity'
echo 'graph_args --base 1000 -l 0'
CAPACITY=$(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 3 | cut -d '/' -f 2 | awk '{ print $1 }')
WARNING=$(echo "scale=2;$CAPACITY * ($WARNING_LEVEL/100)" | bc -l | cut -d '.' -f 1)
CRITICAL=$(echo "scale=2;$CAPACITY * ($CRITICAL_LEVEL/100)" | bc -l | cut -d '.' -f 1)
echo "capacity.label Capacity"
echo "used.label Raw used"
echo "used.draw AREA"
echo "used.warning $WARNING"
echo "used.critical $CRITICAL"
echo "data.label Data"
echo "data.draw AREA"
exit 0
fi
echo "capacity.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 3 | cut -d '/' -f 2 | awk '{ print $1 }')"
echo "used.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 2 | awk '{ print $1 }')"
echo "data.value $(ceph -s | grep pgmap | cut -d ';' -f 2 | cut -d ',' -f 1 | awk '{ print $1 }')"

49
plugins/ceph/ceph_osd Executable file
View file

@ -0,0 +1,49 @@
#!/bin/sh
: << =cut
=head1 NAME
ceph_osd - Shows ceph OSD states (total configured, up and in)
=head1 AUTHOR
Mate Gabri <mate@gabri.hu>
=head1 LICENSE
GPLv2
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title CEPH OSDs'
echo 'graph_category ceph'
echo 'graph_vlabel nr'
echo 'graph_info CEPH OSD up/down status'
echo 'graph_scale no'
echo 'graph_args --base 1000 -l 0'
echo "osds.label OSDs"
echo "up.label Up"
echo "in.label In"
echo "in.draw AREA"
exit 0
fi
echo "osds.value $(ceph -s | grep osdmap | awk '{ print $3 }')"
echo "up.value $(ceph -s | grep osdmap | awk '{ print $5 }')"
echo "in.value $(ceph -s | grep osdmap | awk '{ print $7 }')"