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:
parent
d01aa273a7
commit
4ac9c7ba2e
@ -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')"
|
||||
|
Loading…
Reference in New Issue
Block a user