Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
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