graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #01995
Re: [Question #183344]: Determine why a line is invalid
Question #183344 on Graphite changed:
https://answers.launchpad.net/graphite/+question/183344
Status: Answered => Solved
basketcase confirmed that the question is solved:
FWIW, this is what I was able to get working yesterday (or this morning?
-- nights mess up my sense of time).
#!/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 = 60
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/*')
for file in files:
lines = []
for line in open(file):
drtylines = line.rstrip('\n')
lines.append(drtylines)
data = '\n'.join(lines) + '\n'
print "sending message"
print 80 * '-'
print data
sock.sendall(data)
I'll mark this as resolved...but a new problem is introduced -- will
research further first. I can import 300k records, logs indicate that
it creates data points, but actual graph is incomplete, often only a
"window" of time actually graphed.
Much appreciated for all your help!
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.