- if (rrd_fetch_r(argv[optind], cf, start, end, step, ds_cnt, ds_namv, data)
- != 0)
+ rrdc_connect (opt_daemon);
+ if (rrdc_is_connected (opt_daemon))
+ status = rrdc_fetch (argv[optind], cf, start, end, step,
+ ds_cnt, ds_namv, data);
+
+ else
+ status = rrd_fetch_r(argv[optind], cf, start, end, step,
+ ds_cnt, ds_namv, data);
+
+ if (status != 0)