def _create_rrd(server): path = os.path.join(cfg.VAR_DB_OPENVPS, 'vsmon', '%s.rrd' % server) args = [path, '-s', '60'] for n in xrange(len(cfg.VSMON_DATA_DEF)): field = cfg.VSMON_DATA_DEF[n] if field[1]: args.append( _DS(field[0][:19], dst=field[1], hbeat=field[2], min=field[3], max=field[4])) # here due to the billing policy we will probably need to keep 40 # days of 1 minute samples. at the end of 30 days they should be # transferred to a real database... although - what can't it be # transferred on daily basis? args.append(_RRA('AVERAGE', xff=0.5, steps=1, rows=14400)) # 10 days of 1 min args.append(_RRA('AVERAGE', xff=0.5, steps=10, rows=13392)) # 93 days of 5 min args.append(_RRA('AVERAGE', xff=0.5, steps=43200, rows=120)) # 10 years of 30 days #log(`args`) RRD.create(args)
def _create_rrd(server): path = os.path.join(cfg.VAR_DB_OPENVPS, "vsmon", "%s.rrd" % server) args = [path, "-s", "60"] for n in xrange(len(cfg.VSMON_DATA_DEF)): field = cfg.VSMON_DATA_DEF[n] if field[1]: args.append(_DS(field[0][:19], dst=field[1], hbeat=field[2], min=field[3], max=field[4])) # here due to the billing policy we will probably need to keep 40 # days of 1 minute samples. at the end of 30 days they should be # transferred to a real database... although - what can't it be # transferred on daily basis? args.append(_RRA("AVERAGE", xff=0.5, steps=1, rows=14400)) # 10 days of 1 min args.append(_RRA("AVERAGE", xff=0.5, steps=10, rows=13392)) # 93 days of 5 min args.append(_RRA("AVERAGE", xff=0.5, steps=43200, rows=120)) # 10 years of 30 days # log(`args`) RRD.create(args)