mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-07-10 01:22:14 -04:00
Added -N flag to nc invocation
This commit is contained in:
parent
be4039d647
commit
66d27887f2
@ -41,7 +41,7 @@ prometheus_httpd () {
|
|||||||
echo "Serving prometheus HTTP endpoint at http://localhost:$PROMETHEUS_PORT/metrics"
|
echo "Serving prometheus HTTP endpoint at http://localhost:$PROMETHEUS_PORT/metrics"
|
||||||
while true; do
|
while true; do
|
||||||
local REQUEST RESPONSE
|
local REQUEST RESPONSE
|
||||||
cat $prometheus_httpd_fifo | nc -l $PROMETHEUS_PORT | while read line; do
|
cat $prometheus_httpd_fifo | nc -N -l $PROMETHEUS_PORT | while read line; do
|
||||||
line=$(echo "$line" | tr -d '[\r\n]')
|
line=$(echo "$line" | tr -d '[\r\n]')
|
||||||
# extract the request
|
# extract the request
|
||||||
if echo "$line" | grep -qE '^GET /'; then
|
if echo "$line" | grep -qE '^GET /'; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user