Last active
March 24, 2020 11:17
-
-
Save AGx10k/cdc8ebbc1204a21c0a4a9ee93dc4dcbd to your computer and use it in GitHub Desktop.
This file contains 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 | |
# | |
# Expose directory usage metrics, passed as an argument. | |
# | |
# Usage: add this to crontab: | |
# | |
# */5 * * * * prometheus directory-size.sh /var/lib/prometheus | sponge /var/lib/node_exporter/directory_size.prom | |
# | |
# sed pattern taken from https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/ | |
# | |
# Author: Antoine Beaupré <[email protected]> | |
echo "# HELP QKC_miner_threads gauge miner threads running for QuarkChain miner" | |
echo "# TYPE QKC_miner_threads gauge" | |
main_pid=$(docker top quarkchain-miner | grep ethminer | awk '{print $2}') | |
miner_threads=$(grep "Name:" /proc/${main_pid}/task/*/status | grep -e "\bminer" | wc -l) | |
echo "QKC_miner_threads ${miner_threads}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment