def METHOD_NAME(args):
    data = {
        'operation': 'read-resource',
        'include-runtime': 'true',
        'recursive': 'true',
        # /subsystem/datasources/data-source/" + ds_name + "/statistics/pool/
        'address': [{'subsystem': 'datasources'}, {'data-source': '*'}, {'statistics': 'pool'}],
        'json': 1,
    }
    res = lib.wildfly.get_data(args, data)
    msg = ''
    perfdata = ''
    state = STATE_OK
    ds_stat_types = [
        'BlockingFailureCount',
        'CreatedCount',
        'DestroyedCount',
        'IdleCount',
        'InUseCount',
        'MaxWaitCount',
        'WaitCount',
        # 'XACommitCount',
        # 'XAEndCount',
        # 'XAForgetCount',
        # 'XAPrepareCount',
        # 'XARecoverCount',
        # 'XARollbackCount',
        # 'XAStartCount',
    ]
    for ds in res:
        name = ''
        # get the datasource name
        for v in ds['address']:
            if 'data-source' in v:
                name = v['data-source']
                break
        if args.DATASOURCE is not None:
            # filter for specific datasource
            if not name in args.DATASOURCE:
                continue
        available = int(ds['result']['AvailableCount'])
        if available == 0:
            msg += 'Statistics are not enabled for data source {}; '.format(name)
            continue
        msg += '{}: '.format(name)
        active = int(ds['result']['ActiveCount'])
        max_used = int(ds['result']['MaxUsedCount'])
        if available != 0:
            active_pct = round(float(active) / float(available) * 100, 1)
            max_used_pct = round(float(max_used) / float(available) * 100, 1)
        else:
            active_pct = 0
            max_used_pct = 0
        local_state = lib.base.get_state(active_pct, args.WARN, args.CRIT)
        msg += '{}% active used ({}/{}){}, '.format(active_pct, active, available, lib.base.state2str(local_state, prefix=' '))
        state = lib.base.get_worst(local_state, state)
        local_state = lib.base.get_state(active_pct, args.WARN, args.CRIT)
        msg += '{}% max used ({}/{}){}, '.format(max_used_pct, max_used, available, lib.base.state2str(local_state, prefix=' '))
        state = lib.base.get_worst(local_state, state)
        perfdata += lib.base.get_perfdata('non-xa-ds-{}-available'.format(name), available, None, None, None, 0, available)
        perfdata += lib.base.get_perfdata('non-xa-ds-{}-active'.format(name), active, None, None, None, 0, active)
        perfdata += lib.base.get_perfdata('non-xa-ds-{}-active-pct'.format(name), active_pct, '%', args.WARN, args.CRIT, 0, 100)
        perfdata += lib.base.get_perfdata('non-xa-ds-{}-maxused'.format(name), max_used, None, None, None, 0, available)
        perfdata += lib.base.get_perfdata('non-xa-ds-{}-maxused-pct'.format(name), max_used_pct, '%', args.WARN, args.CRIT, 0, 100)
        for metric in ds_stat_types:
            if metric in ds['result']:
                if ds['result'][metric] > 0:
                    msg += '{}={}, '.format(metric, ds['result'][metric])
                perfdata += lib.base.get_perfdata('non-xa-ds-{}-{}'.format(name, metric.lower()), ds['result'][metric], None, None, None, 0, None)
        msg = msg[:-2] + '; '
    if msg:
        lib.base.oao('{}'.format(msg[:-2]), state, perfdata, always_ok=args.ALWAYS_OK)
    else:
        lib.base.oao('No datasources found.', state)