Hi I did enhancement to my code base to have horizontal threshold line on the rrd graphs, if you pass HRULE in the snmp-graph.properties or responsegraph.properties, it should work. But opennms code base which process these commands in prefabgraphs, disabled processing HRULE.You can check this in JRobinRrdStrategy.java
/**
- <p>createGraphDef</p>
*
- @param workDir a
{@link java.io.File}
object.
- @param commandArray an array of
{@link java.lang.String}
objects.
- @return a
{@link org.jrobin.graph.RrdGraphDef}
object.
- @throws org.jrobin.core.RrdException if any.
*/
protected RrdGraphDef createGraphDef(final File workDir, final String[] commandArray) throws RrdException {
else if (arg.startsWith("HRULE:"))
{
String definition = arg.substring("HRULE:".length());
String[] hrule = tokenize(definition, ":", true);
String[] color = tokenize(hrule[0], "#", true);
graphDef.hrule(Double.parseDouble(color[0]), getColor(color[1]), (hrule.length > 1 ? hrule[1] : ""));
}
-------------------------
in this method i have added to process HRULE command, which we need to give dynamically if your threshold value is changing – by passing it to RrdGraphService –
m_rrdGraphService.getPrefabGraph(resourceId, report, startTime, endTime,
graphHeight, graphWidth, thresholdLineCommand);
append the passed threshold Line Command to it.
Hi I did enhancement to my code base to have horizontal threshold line on the rrd graphs, if you pass HRULE in the snmp-graph.properties or responsegraph.properties, it should work. But opennms code base which process these commands in prefabgraphs, disabled processing HRULE.You can check this in JRobinRrdStrategy.java
/**
*
object.
objects.
object.
*/
protected RrdGraphDef createGraphDef(final File workDir, final String[] commandArray) throws RrdException {
else if (arg.startsWith("HRULE:")) { String definition = arg.substring("HRULE:".length()); String[] hrule = tokenize(definition, ":", true); String[] color = tokenize(hrule[0], "#", true); graphDef.hrule(Double.parseDouble(color[0]), getColor(color[1]), (hrule.length > 1 ? hrule[1] : "")); }
-------------------------
in this method i have added to process HRULE command, which we need to give dynamically if your threshold value is changing – by passing it to RrdGraphService –
m_rrdGraphService.getPrefabGraph(resourceId, report, startTime, endTime,
graphHeight, graphWidth, thresholdLineCommand);
append the passed threshold Line Command to it.