NetXMS Support Forum

English Support => General Support => Topic started by: Asterix on December 27, 2020, 11:12:36 AM

Title: Graph - Stop graphing when some value
Post by: Asterix on December 27, 2020, 11:12:36 AM
Hi,
is possibile to stop graphing when some value is returned?
In my case Ubiquiti device return -1000 of signal strenght when remote device is not connected via radio.

I need to stop graphing instead of get -1000
(http://value.png)

Title: Re: Graph - Stop graphing when some value
Post by: tomaskir on December 27, 2020, 05:16:33 PM
Use a transform script to return "null" when wrong value is received:


if ($1 < -100) {
  return null;
} else {
  return $1;
}
Title: Re: Graph - Stop graphing when some value
Post by: Asterix on December 27, 2020, 06:47:51 PM
When null is returned on the chart it goes a position itself as value 0

Version 3.6.303

Other methods?
Title: Re: Graph - Stop graphing when some value
Post by: tomaskir on December 27, 2020, 07:48:49 PM
Null means data collection error - no value will be stored in the DB, no value will be shown on the chart.
The DCI will show "<<ERROR>>" in Last Values.

If you want 0, simply return 0 in the transform script.
Title: Re: Graph - Stop graphing when some value
Post by: Asterix on December 27, 2020, 08:34:00 PM
I've tried, but in last value I get "0" instead of <<ERROR>>
This is the Transformation
return ($1 < -100) ? null : $1;

Why?
Title: Re: Graph - Stop graphing when some value
Post by: Filipp Sudanov on December 27, 2020, 11:41:44 PM
Try abort instead of return null:

if ($1 < -100) {
  abort;
} else {
  return $1;
}
Title: Re: Graph - Stop graphing when some value
Post by: Asterix on December 28, 2020, 12:20:38 PM
Thanks Filipp!

It Works ! !
Title: Re: Graph - Stop graphing when some value
Post by: Asterix on December 28, 2020, 12:37:23 PM
However, there is an anomaly  :(
If the chart is zoomed out, it tends to close the line between the previous and last retrieved value.
See in my example 1H Graph and 4H same graph

Title: Re: Graph - Stop graphing when some value
Post by: Victor Kirhenshtein on December 28, 2020, 02:34:54 PM
Hi,

there is open change request for that: https://track.radensolutions.com/issue/NX-1826 (https://track.radensolutions.com/issue/NX-1826). Hopefully will fix it soon.

Best regards,
Victor