Question #183344 on Graphite changed:
https://answers.launchpad.net/graphite/+question/183344

basketcase gave more information on the question:
OK.  Now listener.log exists, I can attempt to send data to it.  it
acknowledges that a connection is made, but no data is actually sent:

02/01/2012 16:19:38 :: MetricLineReceiver connection with 127.0.0.1:58674 
established
02/01/2012 16:19:38 :: MetricLineReceiver connection with 127.0.0.1:58674 lost: 
Connection to the other side was lost in a non-clean fashion.
02/01/2012 16:20:36 :: MetricLineReceiver connection with 127.0.0.1:58675 
established
02/01/2012 16:21:46 :: MetricLineReceiver connection with 127.0.0.1:58675 
closed cleanly
02/01/2012 16:36:48 :: MetricLineReceiver connection with 127.0.0.1:58676 
established
02/01/2012 16:37:16 :: MetricLineReceiver connection with 127.0.0.1:58676 
closed cleanly
02/01/2012 16:42:03 :: MetricLineReceiver connection with 127.0.0.1:58677 
established
02/01/2012 16:42:09 :: MetricLineReceiver connection with 127.0.0.1:58677 
closed cleanly

Here is my script to feed it data:

!/usr/bin/python
import fileinput
import glob
import sys
import time
import os
import platform
import subprocess
from socket import socket

CARBON_SERVER = '127.0.0.1'
CARBON_PORT = 2003
delay = 1
sock = socket()
try:
  sock.connect( (CARBON_SERVER,CARBON_PORT) )
except:
  print "Couldn't connect to %(server)s on port %(port)d, is carbon-agent.py 
running?" % { 'server':CARBON_SERVER, 'port':CARBON_PORT }
  sys.exit(1)

files = glob.glob('/opt/graphite/storage/import_data/*')

while True:
        for file in files:
                for line in open(file):
                        data = line.rstrip('\n')
                        print data
                        print
                        sock.sendall(data)
                        time.sleep(delay)

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.

_______________________________________________
Mailing list: https://launchpad.net/~graphite-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~graphite-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to