Skip to content

Instantly share code, notes, and snippets.

@katzefudder
Created July 26, 2016 14:35
Show Gist options
  • Save katzefudder/0707487d21f3a208c1f2ebca4df95b64 to your computer and use it in GitHub Desktop.
Save katzefudder/0707487d21f3a208c1f2ebca4df95b64 to your computer and use it in GitHub Desktop.
Send data to Graphite via netcat
#!/bin/bash
DATE=`date +%s`
HOST=graphite.host
PORT=2003
KEY=my.key
echo "${KEY} 1 ${DATE}" | nc -w 1 $HOST $PORT
@katzefudder
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment