2013-02-08 12:17:02 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
: << =cut
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
ceph_osd - Shows ceph OSD states (total configured, up and in)
|
|
|
|
|
2018-08-24 22:04:59 +02:00
|
|
|
=head1 APPLICABLE SYSTEMS
|
|
|
|
|
|
|
|
Any host with ceph configured and "jq" being installed .
|
|
|
|
|
2013-02-08 12:17:02 +01:00
|
|
|
=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
|
2018-08-02 02:03:42 +02:00
|
|
|
|
2013-02-08 12:17:02 +01:00
|
|
|
echo 'graph_title CEPH OSDs'
|
2017-02-21 22:15:07 +01:00
|
|
|
echo 'graph_category fs'
|
2013-02-08 12:17:02 +01:00
|
|
|
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
|
|
|
|
|
2018-07-25 11:32:41 +02:00
|
|
|
CEPH_STATUS=$(ceph -s --format=json)
|
|
|
|
|
2018-08-24 22:04:59 +02:00
|
|
|
echo "osds.value $(echo "$CEPH_STATUS" | jq '.osdmap.osdmap.num_osds')"
|
|
|
|
echo "up.value $(echo "$CEPH_STATUS" | jq '.osdmap.osdmap.num_up_osds')"
|
|
|
|
echo "in.value $(echo "$CEPH_STATUS" | jq '.osdmap.osdmap.num_in_osds')"
|