Skip to content

Commit

Permalink
Merge pull request #1082 from arthru/patch-1
Browse files Browse the repository at this point in the history
Update feeding-carbon.rst
  • Loading branch information
obfuscurity committed Jan 6, 2015
2 parents 0f24462 + 0635eb3 commit 349d752
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions docs/feeding-carbon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@ The plaintext protocol is the most straightforward protocol supported by Carbon.

The data sent must be in the following format: ``<metric path> <metric value> <metric timestamp>``. Carbon will then help translate this line of text into a metric that the web interface and Whisper understand.

On Unix, the ``nc`` program can be used to create a socket and send data to Carbon (by default, 'plaintext' runs on port 2003):
On Unix, the ``nc`` program (``netcat``) can be used to create a socket and send data to Carbon (by default, 'plaintext' runs on port 2003):

.. code-block:: none
If you use the OpenBSD implementation of ``netcat``, please follow this example:

.. code-block:: none
PORT=2003
SERVER=graphite.your.org
echo "local.random.diceroll 4 `date +%s`" | nc -q0 ${SERVER} ${PORT}
PORT=2003
SERVER=graphite.your.org
echo "local.random.diceroll 4 `date +%s`" | nc -q0 ${SERVER} ${PORT}
The ``-q0`` parameter instructs ``nc`` to close socket once data is sent. Without this option, some ``nc`` versions would keep the connection open.

The ``-q0`` parameter instructs ``nc`` to close socket once data is sent. Without this option, some ``nc`` versions would keep the connection open.
If you use the GNU implementation of ``netcat``, please follow this example:

.. code-block:: none
PORT=2003
SERVER=graphite.your.org
echo "local.random.diceroll 4 `date +%s`" | nc -c ${SERVER} ${PORT}
The ``-c`` parameter instructs ``nc`` to close socket once data is sent. Without this option, ``nc`` will keep the connection open and won't end.

The pickle protocol
-------------------
Expand Down Expand Up @@ -135,4 +146,4 @@ A simple example of doing this from the unix terminal would look like this:
echo "test.bash.stats 42" | nc graphite.example.com 2003
There are many tools that interact with Graphite. See the :doc:`Tools </tools>` page for some choices of tools that may be used to feed Graphite.
There are many tools that interact with Graphite. See the :doc:`Tools </tools>` page for some choices of tools that may be used to feed Graphite.

0 comments on commit 349d752

Please sign in to comment.