Last active
April 29, 2017 08:46
-
-
Save kenzo0107/cf245d3ba1d2f0faea7f0134414a8c81 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/bash | |
set -eu | |
readonly HTTPD_PROM="/usr/local/node_exporter/text_collector/httpd.prom" | |
function get_httpd_count() { | |
local _cnt=$(/sbin/pidof httpd | wc -w) | |
echo "node_httpd_count ${_cnt}" >> ${HTTPD_PROM}.$$ | |
} | |
function finisher() { | |
mv ${HTTPD_PROM}.$$ ${HTTPD_PROM} | |
} | |
get_httpd_count | |
finisher |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment