POW Arithmetic Operator Does not work with Backshift Graphing Engine

Description

When using the default graphing engine to backshift "org.opennms.web.graphs.engine=backshift" the Arithmetic POW Operator does not work.
The same works when we set the grahing engine to "png"

RRD Docs on Arithmetic Operator

https://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html

RPN-Eval Code in ONMS

https://github.com/OpenNMS/backshift/blob/925662f6cbcf5a23a699942edd10fd1204d1609f/src/Backshift.Utilities.RpnEvaluator.js

 

Graph Definitions

### Temperature Graphs report.cisco.env.temp.name=Cisco Environmentals (Temperature) report.cisco.env.temp.columns=entSensorValue,entSensorPrecision report.cisco.env.temp.propertiesValues=entPhysicalName report.cisco.env.temp.type=ciscoEnvMonTmpIndex report.cisco.env.temp.command=--title="Temperature Reading for {entPhysicalName}" \  --lower-limit=0 \  --vertical-label="Celcius(C)" \  DEF:entSensor={rrd1}:entSensorValue:AVERAGE \  DEF:entSensorPre={rrd2}:entSensorPrecision:AVERAGE \  CDEF:tempVal=entSensor,10,entSensorPre,POW,/ \  LINE2:entSensor#fcaf3e:"Pre-Calc Temp" \  AREA:tempVal#fcaf3e \  LINE2:tempVal#f57900:"Temperature" \  GPRINT:tempVal:AVERAGE:" Avg  \\: %8.2lf %s" \  GPRINT:tempVal:MIN:"Min  \\: %8.2lf %s" \  GPRINT:tempVal:MAX:"Max  \\: %8.2lf %s\\n"

With PNG

With +Backshift

+

Acceptance / Success Criteria

None

Attachments

4
  • 12 Apr 2023, 09:12 PM
  • 12 Apr 2023, 09:12 PM
  • 26 Sep 2022, 06:02 AM
  • 26 Sep 2022, 05:53 AM

Lucidchart Diagrams

Activity

Show:

Dmitri Herdt May 3, 2023 at 1:30 PM

Sriraag Sridhar April 13, 2023 at 4:00 PM

I see POW Added in below file

https://github.com/OpenNMS/backshift/blob/v1.3.1/src/Backshift.Utilities.RpnEvaluator.js

this.operators['POW'] = funcOp(function(a, b) { return Math.pow(a, b); }, 2);

But no POW in this file below, not sure if that could be the issue ??

https://github.com/OpenNMS/backshift/blob/v1.3.1/src/Backshift.Utilities.RpnToJexlConverter.js

Sergio Garcia April 13, 2023 at 3:18 PM

I saw that this was reopened. Let me know if I can help with testing in any way.

Sergio Garcia April 12, 2023 at 9:12 PM

Hello team,

I have updated to Horizon 31.0.6 and still have the issue with Backshift not properly displaying graphs that are using the POW function in the SNMP graph definition. Here is what I have defined:

### Temperature Graphs report.entSensorValueTable.sensorValues.name=Cisco Sensor Reading report.entSensorValueTable.sensorValues.columns=entSensorValue,entSensorPrecision,entSensorScale report.entSensorValueTable.sensorValues.propertiesValues=entPhysName,entSensorTypeText,powexp report.entSensorValueTable.sensorValues.type=entSensorValueEntry report.entSensorValueTable.sensorValues.command=--title="Sensor Reading for {entPhysName}" \ --vertical-label="{entSensorTypeText}" \ DEF:entSensor={rrd1}:entSensorValue:AVERAGE \ DEF:entSensorPre={rrd2}:entSensorPrecision:AVERAGE \ DEF:entSensorSca={rrd3}:entSensorScale:AVERAGE \ CDEF:tempVal=entSensor,10,entSensorPre,POW,* \ CDEF:tempValScaled=tempVal,10,{powexp},POW,* \ AREA:tempValScaled#fcaf3e \ LINE2:tempValScaled#f57900:"{entSensorTypeText}" \ GPRINT:tempValScaled:AVERAGE:" Avg \\: %8.2lf %s" \ GPRINT:tempValScaled:MIN:"Min \\: %8.2lf %s" \ GPRINT:tempValScaled:MAX:"Max \\: %8.2lf %s\\n"

However, I’m not seeing any graphs being created:

If I set the graphing engine to PNG, it works fine:

I believe this is the same issue that Sriraag had. I’m not sure if this is an issue with Backshift per se, but I wanted to post in here first before opening a new issue or re-opening this one.

Benjamin Reed March 14, 2023 at 8:17 PM

I tagged a new Backshift version with the POW fixes (and some other changes that never got released). PR for applying the updated version in foundation-2020 is awaiting review.

Fixed

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

FD#

Components

Sprint

Affects versions

Priority

PagerDuty

Created September 26, 2022 at 5:50 AM
Updated May 9, 2023 at 1:40 PM
Resolved May 9, 2023 at 1:40 PM