I read in another post that it's as easy to try to create a new rrd database and fail gracefully, than to check for it's existence and conditionally create it, so I took from that that there isn't a 'one-time initialization step' of an rrd database that I need to do before starting. Also, the error I'm getting isn't 'no database', rather it's failing during a create stage:
RRD: creating rrd file /var/btmon/rrd/01000463_volts.rrd
Exception in RRDProcessor: argument 5 must be string
Here's my btmon.cfg:
Code: Select all
>cat btmon.cfg
[source]
device_type = gem
ip_read = true
ip_host = 10.0.0.2
ip_port = 5000
ip_mode = client
[rrd]
rrd_out = true
rrd_dir = /var/btmon/rrd
>
Code: Select all
>./btmon.py -c btmon.cfg --debug
2013/03/26 19:20:01 device type: gem
2013/03/26 19:20:01 device list: ['']
2013/03/26 19:20:01 packet format: gem48ptbin
2013/03/26 19:20:01 schema: counters
2013/03/26 19:20:01 buffer size: 120
2013/03/26 19:20:01 SOCKET: timeout: 15
2013/03/26 19:20:01 SOCKET: server host: 10.0.0.2
2013/03/26 19:20:01 SOCKET: server port: 5000
2013/03/26 19:20:01 RRD: update period: 60
2013/03/26 19:20:01 RRD: dir: /var/btmon/rrd
2013/03/26 19:20:01 RRD: step: 10
2013/03/26 19:20:01 RRD: heartbeat: 20
2013/03/26 19:20:01 packet format is GEM48PTBinaryPacket
2013/03/26 19:20:01 using collector BlockingSocketClientCollector
2013/03/26 19:20:01 using 1 processors:
2013/03/26 19:20:01 RRDProcessor
2013/03/26 19:20:01 setup BlockingSocketClientCollector
2013/03/26 19:20:01 opening socket connection to 10.0.0.2:5000
2013/03/26 19:20:01 setup RRDProcessor
2013/03/26 19:20:01 SOCKET: waiting for data
2013/03/26 19:20:01 reading 1 of 1 packets
2013/03/26 19:20:08 adding buffer for 01000463
2013/03/26 19:20:08 buffering packet ts:1364340008 sn:01000463
2013/03/26 19:20:08 buffer info:
2013/03/26 19:20:08 01000463: 1 of 120 (1364340008)
2013/03/26 19:20:08 processing with RRDProcessor
2013/03/26 19:20:08 not enough data for 01000463
2013/03/26 19:20:08 SOCKET: waiting for data
2013/03/26 19:20:08 reading 1 of 1 packets
2013/03/26 19:20:17 buffering packet ts:1364340017 sn:01000463
2013/03/26 19:20:17 buffer info:
2013/03/26 19:20:17 01000463: 2 of 120 (1364340017)
2013/03/26 19:20:17 processing with RRDProcessor
2013/03/26 19:20:17 2 buffered packets sn:01000463
2013/03/26 19:20:17 1 calculated packets sn:01000463
2013/03/26 19:20:17 RRD: creating rrd file /var/btmon/rrd/01000463_volts.rrd
2013/03/26 19:20:17 Exception in RRDProcessor: argument 5 must be string
Traceback (most recent call last):
File "./btmon.py", line 1987, in process
p.process_compiled(self.packet_collector.packet_buffer)
File "./btmon.py", line 2557, in process_compiled
self.process_calculated(packets)
File "./btmon.py", line 2853, in process_calculated
self._process_all(packets)
File "./btmon.py", line 2862, in _process_all
self._update_files(packets)
File "./btmon.py", line 2835, in _update_files
self._create_rrd(p, x, t)
File "./btmon.py", line 2810, in _create_rrd
"RRA:MIN:0.5:%d:%d" % (RRD_STEPS[3],RRD_RESOLUTIONS[3]))
TypeError: argument 5 must be string
2013/03/26 19:20:17 SOCKET: waiting for data
2013/03/26 19:20:17 reading 1 of 1 packets
^C2013/03/26 19:20:22 cleanup RRDProcessor
2013/03/26 19:20:22 cleanup BlockingSocketClientCollector
2013/03/26 19:20:22 closing socket connection
>
Code: Select all
>./btmon.py --device-type=gem --ip --ip-host=10.0.0.2 --ip-port=5000 --ip-mode=client --print
2013/03/26 19:26:03 device type: gem
2013/03/26 19:26:03 device list: ['']
2013/03/26 19:26:03 packet format: gem48ptbin
2013/03/26 19:26:03 schema: counters
2013/03/26 19:26:03 SOCKET: timeout: 15
2013/03/26 19:26:03 SOCKET: server host: 10.0.0.2
2013/03/26 19:26:03 SOCKET: server port: 5000
2013/03/26 19:26:17: Serial: 01000463
2013/03/26 19:26:17: Voltage: 121.10V
2013/03/26 19:26:17: Ch01: -220.718599KWh (-4437W)
2013/03/26 19:26:17: Ch02: -86.934899KWh ( -478W)
2013/03/26 19:26:17: Ch03: -15.590492KWh ( -3W)
2013/03/26 19:26:17: Ch04: -25.306183KWh (-2211W)
2013/03/26 19:26:17: Ch05: -0.176301KWh ( -7W)
2013/03/26 19:26:17: Ch06: -0.019482KWh ( 0W)
2013/03/26 19:26:17: Ch07: -0.988829KWh ( -267W)
<snipped for brevity>
Any thoughts? Is this a configuration problem?
I'm running python 2.7.3 on FreeBSD, if it matters.