NetXMS Support Forum

English Support => General Support => Topic started by: rostyslav on December 12, 2012, 11:14:45 AM

Title: DCI Error issue
Post by: rostyslav on December 12, 2012, 11:14:45 AM
Hello,

I'm trying to implement service that downloads file from my servers and gives me time of download. I am doing this via ExternalParameter.
Of course if download time is bigger then ExecTimeout in agent config I get an << ERROR >>. I want to change this error value to integer.
For example, if my download time is greater then 45 seconds, then return 60. I've tried to add the following transformation script, but it doesn't work.
Will be grateful for any help.

sub main ()
{
  if ($1 < 46)
    return $1;
  else
    return 60;
}
Title: Re: DCI Error issue
Post by: SKYnv on December 12, 2012, 12:27:36 PM
Quote from: rostyslav on December 12, 2012, 11:14:45 AM
Hello,

I'm trying to implement service that downloads file from my servers and gives me time of download. I am doing this via ExternalParameter.
Of course if download time is bigger then ExecTimeout in agent config I get an << ERROR >>. I want to change this error value to integer.
For example, if my download time is greater then 45 seconds, then return 60. I've tried to add the following transformation script, but it doesn't work.
Will be grateful for any help.

sub main ()
{
  if ($1 < 46)
    return $1;
  else
    return 60;
}


history for this DCI?
Title: Re: DCI Error issue
Post by: rostyslav on December 12, 2012, 12:37:33 PM
There is no history.
Title: Re: DCI Error issue
Post by: SKYnv on December 12, 2012, 04:46:41 PM
Quote from: rostyslav on December 12, 2012, 12:37:33 PM
There is no history.
collect some raw value (without transformation)
Title: Re: DCI Error issue
Post by: Victor Kirhenshtein on December 12, 2012, 10:41:02 PM
Hi!

Basically, you cannot convert data collection error to value. You only can set threshold on that. For long-running external parameters I would recommend using external parameter provider instead: http://wiki.netxms.org/wiki/ExternalParametersProvider (http://wiki.netxms.org/wiki/ExternalParametersProvider).

Best regards,
Victor