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