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

34 lines
665 B
Plaintext
Raw Normal View History

2013-06-07 23:37:01 +02:00
#!/bin/bash
# Damien Alexandre © 2013
#
# Output number of documents per Sphinx Index
# Need indextool (since version 0.9.9 )
2013-06-07 23:43:34 +02:00
# Index path (where .sphx files are)
2013-06-07 23:37:01 +02:00
idxpath=/var/lib/sphinxsearch/data/
#
#
case $1 in
config)
cat <<'EOM'
2013-06-07 23:43:34 +02:00
graph_title Documents per index
graph_vlabel number
2013-06-07 23:37:01 +02:00
graph_scale no
graph_category sphinx
graph_info Report number of documents (using indextool) by Sphinx Index.
EOM
for i in `ls $idxpath/*.sph`; do
fn=`basename $i .sph`
echo "$fn.label $fn"
done
exit 0;;
esac
for i in `ls $idxpath/*.sph`; do
echo -n "`basename $i .sph`.value "
echo `indextool --dumpheader $i | grep ^total-doc | cut -f2 -d\:`
done