Last active
December 22, 2015 23:49
-
-
Save tkhn/6549577 to your computer and use it in GitHub Desktop.
Munin plugin to monitor docs number in bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| case $1 in | |
| config) | |
| cat <<'EOM' | |
| graph_title Sphinx index main stats | |
| graph_vlabel docs count | |
| graph_category sphinx | |
| documents_count.label Documents count in index | |
| graph_args --base 1000 -l 0" | |
| EOM | |
| exit 0;; | |
| esac | |
| num=$( echo "SELECT * FROM main LIMIT 0; SHOW META;" | mysql -h 127.0.0.1 -P 9306 | grep "total_found" | cut -f2 ) | |
| echo "documents_count.value $num" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment