2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Use JSON format to obtain data from 'ceph -s'

'ceph -s' text output format strongly depends upon ceph version. Using JSON format to obtain data works across different ceph versions.
This commit is contained in:
Xavier Serrano 2018-07-25 10:49:58 +02:00 committed by GitHub
parent d01aa273a7
commit 4ac9c7ba2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,6 @@ if [ "$1" = "config" ]; then
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 }')"
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')"