NetXMS Support Forum

English Support => General Support => Topic started by: dushyantmdave on October 05, 2012, 03:10:35 PM

Title: Error in Transformation Script
Post by: dushyantmdave on October 05, 2012, 03:10:35 PM
Hello Victor,

I have configured netxms 1.2.2 with OID .1.3.6.1.2.1.67.2.1.1.1.5.0
when I am shutting down my radius server the OID value showing too high tps in the value column

when I am using following transformation script
if ($1 > 5000)
  return 0;

it is not working in transformation script

Thanks & Regards,
Dushyant Dave
Title: Re: Error in Transformation Script
Post by: SKYnv on October 05, 2012, 04:11:18 PM
post script pls
Title: Re: Error in Transformation Script
Post by: bdefloo on October 05, 2012, 04:24:58 PM
Hello Dave,

I've tried out
if ($1 > 5000)
  return 0;

on a test DCI (on v1.2.3, though), and it seems to work as expected.
Are you sure the script is applied to radiusAccServTotalResponses, and not just only to the Requests DCI?
Also keep in mind that the script does not work retroactively; it will only change the results of the DCI after the change was made.

If you can post some screenshots of the General and Transformation tabs of the DCI, maybe we can find something out of the ordinary there.
Title: Re: Error in Transformation Script
Post by: dushyantmdave on October 05, 2012, 04:26:03 PM
please find the script:

sub main()
{
   if ($1 > 5000)
      return 0;
}
Title: Re: Error in Transformation Script
Post by: dushyantmdave on October 05, 2012, 04:28:58 PM
Please find attached screenshots version 1.2.2
Title: Re: Error in Transformation Script
Post by: dushyantmdave on October 05, 2012, 04:38:17 PM
you mean to say, I have to user version 1.2.3?
I can't see the history after putting this script.
Title: Re: Error in Transformation Script
Post by: SKYnv on October 05, 2012, 05:17:15 PM
can yo check this?
if ($1 > 5000)
return 0;
else
return $1;
Title: Re: Error in Transformation Script
Post by: SKYnv on October 05, 2012, 05:22:12 PM
also you can debug with this trace function

sub main()
{
trace(1, "Raw value=".$1);
if ($1 > 5000)
return 0;
}


and if you start netxmsd with debug level 1 option you see raw value=xx in netxms logfile.


and set data type to integer because original data type is Counter 32bits
Title: Re: Error in Transformation Script
Post by: dushyantmdave on October 06, 2012, 10:13:50 AM
Hello SKYnv,

I have tried following script and it is running successfully.

if ($1 > 5000)
return 0;
else
return $1;

thank you very much. :)