Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Last active April 29, 2017 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo0107/cf245d3ba1d2f0faea7f0134414a8c81 to your computer and use it in GitHub Desktop.
Save kenzo0107/cf245d3ba1d2f0faea7f0134414a8c81 to your computer and use it in GitHub Desktop.
#!/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