+function ident_matches (selector, ident) /* {{{ */
+{
+ var part_matches = function (s,p)
+ {
+ if (s == null)
+ return (false);
+
+ if ((s == "/any/") || (s == "/all/"))
+ return (true);
+
+ if (p == null)
+ return (false);
+
+ if (s == p)
+ return (true);
+
+ return (false);
+ };
+
+ if (!part_matches (selector.host, ident.host))
+ return (false);
+
+ if (!part_matches (selector.plugin, ident.plugin))
+ return (false);
+
+ if (!part_matches (selector.plugin_instance, ident.plugin_instance))
+ return (false);
+
+ if (!part_matches (selector.type, ident.type))
+ return (false);
+
+ if (!part_matches (selector.type_instance, ident.type_instance))
+ return (false);
+
+ return (true);
+} /* }}} function ident_matches */
+
+function ident_describe (ident, selector) /* {{{ */
+{
+ var ret = "";
+ var check_field = function (field)
+ {
+ if (ident[field].toLowerCase () != selector[field].toLowerCase ())
+ {
+ if (ret != "")
+ ret += "/";
+ ret += ident[field];
+ }
+ };
+
+ check_field ("host");
+ check_field ("plugin");
+ check_field ("plugin_instance");
+ check_field ("type");
+ check_field ("type_instance");
+
+ if (ret == "")
+ return (null);
+ return (ret);
+} /* }}} function ident_describe */
+
+/*
+ * Given one metric definition, returns the appropriate metric data from the
+ * graph data (data list). */
+function metric_def_get_data (metric_def, graph_data)