Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (21 sloc) 0.448 kb
#!/bin/bash
#
# Very simple bash client to send metrics to a statsd server
# Example with gauge: ./statsd-client.sh 'my_metric:100|g'
#
# Alexander Fortin <alexander.fortin@gmail.com>
#
STATSD="statsd-ip-address"
PORT="8125"
if [ $# -ne 1 ]
then
echo "Syntax: $0 '<gauge_data_for_statsd>'"
exit 1
fi
# Setup UDP socket with statsd server
exec 3<> /dev/udp/${STATSD}/${PORT}
# Send data
echo "$1" >&3
# Close UDP socket
exec 3<&-
exec 3>&-
Jump to Line
Something went wrong with that request. Please try again.