containers-nginx/prometheusd.sh

18 lines
340 B
Bash
Raw Normal View History

2022-03-04 03:25:40 +00:00
#!/bin/sh
set -e
pid=/tmp/prometheus.pid
case $1 in
start)
daemonize -c /tmp -p ${pid} -l ${pid} -u nobody \
2022-09-10 18:54:46 +00:00
/usr/local/bin/syslogize \
2022-03-04 03:25:40 +00:00
/usr/bin/nginx-prometheus-exporter -nginx.scrape-uri http://127.0.0.1:8080/stub_status
;;
stop)
2022-09-10 18:54:46 +00:00
test ! -f ${pid} || cat ${pid} | xargs -r kill
rm -f ${pid}
2022-03-04 03:25:40 +00:00
;;
esac