Supress other alerts when node down anyway.

Started by Egert143, November 02, 2022, 02:31:29 PM

Previous topic - Next topic

Egert143

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? 

Filipp Sudanov

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.

Egert143

it was giving script errors, so i changed it bit:

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

return true;

Filipp Sudanov

Last line
return $1;is there so transformation script returns DCI's value. Currently your DCI return "true" all the time.