mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
4ac9c7ba2e
'ceph -s' text output format strongly depends upon ceph version. Using JSON format to obtain data works across different ceph versions.
50 lines
829 B
Bash
Executable File
50 lines
829 B
Bash
Executable File
#!/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 fs'
|
|
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 --format=json | jq '.osdmap.osdmap.num_osds')"
|
|
echo "up.value $(ceph -s --format=json | jq '.osdmap.osdmap.num_up_osds')"
|
|
echo "in.value $(ceph -s --format=json | jq '.osdmap.osdmap.num_in_osds')"
|