1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00
Munin-Contrib/plugins/sphinx/sphinx_documents
Lars Kruse 17f784270a Whitespace cleanup
* remove trailing whitespace
* remove empty lines at the end of files
2018-08-02 02:33:25 +02:00

33 lines
664 B
Bash
Executable file

#!/bin/bash
# Damien Alexandre © 2013
#
# Output number of documents per Sphinx Index
# Need indextool (since version 0.9.9 )
# Index path (where .sphx files are)
idxpath=/var/lib/sphinxsearch/data/
#
#
case $1 in
config)
cat <<'EOM'
graph_title Documents per index
graph_vlabel number
graph_scale no
graph_category search
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