Created
July 26, 2016 14:35
-
-
Save katzefudder/0707487d21f3a208c1f2ebca4df95b64 to your computer and use it in GitHub Desktop.
Send data to Graphite via netcat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE=`date +%s` | |
HOST=graphite.host | |
PORT=2003 | |
KEY=my.key | |
echo "${KEY} 1 ${DATE}" | nc -w 1 $HOST $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As this is about sending arbitrary data via TCP, and you probably have Graphite (or carbon) running on a different port - changing the port would be all you need to do.
See netcat's man page for reference: https://linux.die.net/man/1/nc