HRULE not working in JRobin graphs
Description
Environment
Acceptance / Success Criteria
Lucidchart Diagrams
Activity
Ron Roskens June 16, 2014 at 10:25 PM
This is fixed in commit 90543d71e40e91218e1f0f50bacba082876f6947.
Ronny Trommer August 23, 2013 at 9:15 AMEdited
I tried if HRULE is working on 1.12 stable without success. I used the Load Average graph with RRD tool and JRobin.
report.netsnmp.loadavg.name=Load Average
report.netsnmp.loadavg.columns=loadavg1, loadavg5, loadavg15
report.netsnmp.loadavg.type=nodeSnmp
report.netsnmp.loadavg.command=--title="Load Average" --units-exponent=0 \
DEF:avg1={rrd1}:loadavg1:AVERAGE \
DEF:minAvg1={rrd1}:loadavg1:MIN \
DEF:maxAvg1={rrd1}:loadavg1:MAX \
DEF:avg5={rrd2}:loadavg5:AVERAGE \
DEF:minAvg5={rrd2}:loadavg5:MIN \
DEF:maxAvg5={rrd2}:loadavg5:MAX \
DEF:avg15={rrd3}:loadavg15:AVERAGE \
DEF:minAvg15={rrd3}:loadavg15:MIN \
DEF:maxAvg15={rrd3}:loadavg15:MAX \
CDEF:float1=avg1,100,/ \
CDEF:minFloat1=minAvg1,100,/ \
CDEF:maxFloat1=maxAvg1,100,/ \
CDEF:float5=avg5,100,/ \
CDEF:minFloat5=minAvg5,100,/ \
CDEF:maxFloat5=maxAvg5,100,/ \
CDEF:float15=avg15,100,/ \
CDEF:minFloat15=minAvg15,100,/ \
CDEF:maxFloat15=maxAvg15,100,/ \
HRULE:2#ff0000 \
AREA:float1#babdb6:"1 minute" \
GPRINT:float1:AVERAGE:"Avg
: %10.2lf" \
GPRINT:float1:MIN:"Min
: %10.2lf" \
GPRINT:float1:MAX:"Max
: %10.2lf
n" \
AREA:float5#888a85:"5 minute" \
GPRINT:float5:AVERAGE:"Avg
: %10.2lf" \
GPRINT:float5:MIN:"Min
: %10.2lf" \
GPRINT:float5:MAX:"Max
: %10.2lf
n" \
LINE2:float15#a40000:"15 minute" \
GPRINT:float15:AVERAGE:"Avg
: %10.2lf" \
GPRINT:float15:MIN:"Min
: %10.2lf" \
GPRINT:float15:MAX:"Max
: %10.2lf
n"
Alejandro Galue March 12, 2013 at 3:54 PM
Unfortunately the fix has broken the template for strafeping. The good news is that the broken line on strafeping should not be there ...
Here is the line in question:
HRULE:0#000000 \
After removing it, the template started to work as expected; BUT, with RRDtool it works just fine (with or without the line), so I'm not sure if the solution is correct as the above line is valid according with the RRDtool documentation.
A JUnit test will be good for this particular fix.
Jeff Gehlbach February 20, 2013 at 4:43 PM
Fixed this in support of https://mynms.opennms.com/Ticket/Display.html?id=2010
mvssrmurthyattlassian March 14, 2012 at 2:19 AM
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.
It would be nice to see a line that shows the thresholds in graphs.