NetXMS Support Forum

English Support => General Support => Topic started by: Egert143 on November 02, 2022, 02:31:29 PM

Title: Supress other alerts when node down anyway.
Post by: Egert143 on November 02, 2022, 02:31:29 PM
On some nodes i have dci that logs packet loss. when node is unreachable i get two alerts, one for node down and another one for high packet loss. Is it possible to mute other dci alerts when node is already unreachable? 
Title: Re: Supress other alerts when node down anyway.
Post by: Filipp Sudanov on November 03, 2022, 02:44:57 PM
You can make transformation script like this for your packet loss DCI:

if ($node->state & NodeState::Unreachable) abort;
return $1;

"abort" keyword will cancel collection of datapoint. You can also use "return null" instead of "abort" - this will put the DCI into data collection error.
Title: Re: Supress other alerts when node down anyway.
Post by: Egert143 on November 04, 2022, 11:32:45 AM
it was giving script errors, so i changed it bit:

if ($node->state & NodeState::Unreachable) {
abort;
}

return true;
Title: Re: Supress other alerts when node down anyway.
Post by: Filipp Sudanov on November 04, 2022, 06:10:33 PM
Last line
return $1;is there so transformation script returns DCI's value. Currently your DCI return "true" all the time.