diff --git a/deploy/roles/collectd/templates/admin.conf b/deploy/roles/collectd/templates/admin.conf index 7539a07..91e7000 100644 --- a/deploy/roles/collectd/templates/admin.conf +++ b/deploy/roles/collectd/templates/admin.conf @@ -1,27 +1,28 @@ FQDNLookup false Interval 1 Timeout 2 #LoadPlugin rrdtool LoadPlugin network LoadPlugin python LoadPlugin thermal Listen "{{ groups.admin[0] }}" + MaxPacketSize 4096 # # DataDir "/var/lib/collectd/rrd" # ModulePath "/etc/collectd" LogTraces true Interactive false Import "leds" Filter "*.conf" diff --git a/deploy/roles/collectd/templates/compute.conf b/deploy/roles/collectd/templates/compute.conf index ea73455..151eb80 100644 --- a/deploy/roles/collectd/templates/compute.conf +++ b/deploy/roles/collectd/templates/compute.conf @@ -1,22 +1,23 @@ FQDNLookup false Interval 1 Timeout 2 LoadPlugin network LoadPlugin thermal LoadPlugin python Server "{{ groups.admin[0] }}" + MaxPacketSize 1024 ModulePath "/etc/collectd" LogTraces true Interactive false Import "leds" Filter "*.conf" diff --git a/deploy/roles/collectd/templates/demo.py b/deploy/roles/collectd/templates/demo.py index 95f1b1c..310ee8a 100644 --- a/deploy/roles/collectd/templates/demo.py +++ b/deploy/roles/collectd/templates/demo.py @@ -1,78 +1,78 @@ #!/usr/bin/env python2 import serial import time DEBUG = 1 SERIAL = 1 PORT = '/dev/ttyS1' SPEED = 9600 LEDS_NUMBER = 8 LEDS_MAX = 100 TIME = 0.1 def debug(msg): if DEBUG: f = open('/tmp/debug_demo', 'a+') f.write(str(msg) + "\n") f.close() def write(line): if SERIAL: ser.write(line) debug(line) def kitt(ser): for i in [0, 1, 2, 3, 2, 1]: for j in xrange(4): line = 'l%d ' % j + '%d 0 0 ' % (LEDS_MAX if i==j else 0) * LEDS_NUMBER write(line) time.sleep(TIME) def colors(): step = 32 for r in xrange(0, LEDS_MAX, step): for g in xrange(0, LEDS_MAX, step): for b in xrange(0, LEDS_MAX, step): for index in xrange(4): line = 'l%d ' % index + '%d %d %d ' % (r, g, b) * LEDS_NUMBER write(line) time.sleep(TIME) def text(): letters = { - 'E': [[0,1,1,1,1,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0]], - 'P': [[0,1,1,1,1,1,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,1,1,0,0,0,0]], - 'F': [[0,1,1,1,1,1,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0]], - 'L': [[0,1,1,1,1,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0]], - #'S': [[0,1,1,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,1,1,0,0]], + 'E': [[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,1,1,1,1,0,0]], + 'P': [[0,1,1,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,1,1,1,1,0,0]], + 'F': [[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,1,1,1,1,0,0]], + 'L': [[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,1,1,1,1,1,0,0]], + #'S': [[0,1,0,1,1,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,1,1,0,1,0,0]], #'C': [[0,1,1,1,1,1,0,0],[0,1,0,0,0,1,0,0],[0,1,0,0,0,1,0,0],[0,1,1,1,1,1,0,0]], - #'I': [[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]], - #'T': [[0,1,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,1,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]], + #'I': [[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,0,0,0,0,0,0,0]], + #'T': [[0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,1,0,0,0,0,0,0]], #'A': [[0,1,1,1,1,1,0,0],[0,1,0,1,0,0,0,0],[0,1,0,1,0,0,0,0],[0,1,1,1,1,1,0,0]], - #'S': [[0,1,1,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,1,1,0,0]], + #'S': [[0,1,0,1,1,1,0,0],[0,1,0,1,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,1,1,0,1,0,0]], '_': [[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]], } for l in letters.keys(): index = 0 for r in letters[l]: line = 'l%d ' % index \ + ' '.join([str(x).replace("1", str(LEDS_MAX)) + ' 0 0 ' for x in r]) write(line) index += 1 time.sleep(0.5) ser = None if SERIAL: ser = serial.Serial(PORT, SPEED) try: while True: text() #colors() #kitt() except KeyboardInterrupt: if SERIAL: ser.close()