Thank you Sir!

Sent from my iPhone

On 24/09/2018, at 21:44, Adam Armstrong <adama@memetic.org> wrote:

I did once find a maths library that we'd use to do this, i'll have to find it again.

It'd let you put in a formula to apply to values received from end devices.

It would also be useful to be able to custom define some RPN to be used when drawing graphs.

adam.

On 2018-09-24 09:41:02, Peter De Wit <pieter.dewit@hitechsolutions.co.nz> wrote:

Hi Guys,

We are getting data from the custom OID's and I would like to run a math function on this data before putting it into the DB (some of them are Voltages that need to be divide by 100 to be useful)

Here is the patch for what I current do - which is very hacky and not nice:

Index: includes/polling/oids.inc.php
===================================================================
--- includes/polling/oids.inc.php (revision 9443)
+++ includes/polling/oids.inc.php (working copy)
@@ -25,6 +25,7 @@

if (is_numeric($value))
{
+ $value=$value/100;
$update_oid = array(); // Init!
$update_oid['raw_value'] = $value;
$update_oid['timestamp'] = time();

I would like to know, how can I modify the Custom OID "page" to allow 2 fields into the DB:

* A drop down that will allow the user to select the math operator or N/A
* A value to apply with the math operator

I imaging that something like "/" will be loaded into the first field and 100 into the second. Any other suggestions/comments ?

Thanks,

Pieter
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium