aouyar/PyMunin — Issue #14: setSubgraphVal() does not work yet
Author: derek-veit
Created: 2012-02-27 18:42:28+00:00
State: open

MuninPlugin.setSubgraphVal() does not work yet (as of 0.9.7).

But I have successfully used it by making this change:

@@ -371,9 +371,15 @@
@param valDict: Dictionary of monitored values

"""
- graph = self._graphDict.get(parent_name)
- if graph is not None:
- graph.setVal("%s.%s" % (parent_name, graph_name), val)
+ subgraphs = self._subGraphDict.get(parent_name)
+ if subgraphs is not None:
+ subgraph = subgraphs.get(graph_name)
+ if subgraph is not None:
+ subgraph.setVal(field_name, val)
+ else:
+ raise AttributeError("Invalid subgraph name %s used "
+ "with parent graph %s."
+ % (graph_name, parent_name))
else:
raise AttributeError("Invalid parent graph name %s used "
"for setting value for subgraph %s."

The parameters in the docstring would also need to be revised.