src/rrd_{fetch,graph,update}.c: Use the `RRDCACHED_ADDRESS' environment variable..
[rrdtool.git] / src / rrd_graph.c
index 1e597d1..7dfb9ce 100644 (file)
@@ -4222,6 +4222,26 @@ void rrd_graph_options(
                 rrd_set_error("unknown option '%s'", argv[optind - 1]);
             return;
         }
+    } /* while (1) */
+
+    if (im->use_rrdcached == 0)
+    {
+        char *temp;
+
+        temp = getenv (ENV_RRDCACHED_ADDRESS);
+        if (temp != NULL)
+        {
+            int status;
+
+            status = rrdc_connect (temp);
+            if (status != 0)
+            {
+                rrd_set_error ("rrdc_connect(%s) failed with status %i.",
+                        temp, status);
+                return;
+            }
+            im->use_rrdcached = 1;
+        }
     }
 
     if (im->logarithmic && im->minval <= 0) {