def smartmon_loop(devices, hostname, interval):
    while True:
        for dev in devices:
            if dev_exists(dev):
                for attr in SmartDevice(dev).attributes():
                    print('PUTVAL "{hostname}/smart-{dev}/absolute-{attr_id:03d}_{attr_name}" interval={interval:d} N:{value:d}'.format(hostname=hostname, dev=dev, attr_id=int(attr['id']), attr_name=attr.get('name'), interval=int(interval), value=int(attr['raw_value'])))
        time.sleep(interval)
def smartmon_loop(devices, hostname, interval):
    while True:
        for dev in devices:
            if dev_exists(dev):
                for attr in SmartDevice(dev).attributes():
                    print('PUTVAL "{hostname}/smart-{dev}/absolute-{attr_id:03d}_{attr_name}" interval={interval:d} N:{value:d}'.format(hostname=hostname, dev=dev, attr_id=int(attr['id']), attr_name=attr.get('name'), interval=int(interval), value=int(attr['raw_value'])))
        time.sleep(interval)