NetXMS Support Forum

English Support => General Support => Topic started by: johnny on March 26, 2018, 04:56:23 PM

Title: Specific Interfaces send email to another additional address
Post by: johnny on March 26, 2018, 04:56:23 PM
Hello all,
I have a question, is there a way for some specific interfaces from a node send email alerts on another additional email address, when the interface change state other than expected?
thank you in advance
Title: Re: Specific Interfaces send email to another additional address
Post by: Tursiops on March 27, 2018, 03:51:16 PM
I haven't actually tried this with interfaces (done something similar, but not quite the same with nodes), but the following should work:

Title: Re: Specific Interfaces send email to another additional address
Post by: johnny on March 30, 2018, 12:46:23 PM
I've done it little different,
What I was trying to do, is from a new event policy I selected the specific interfaces I wanted as source objects, but it was not working for some reason, It excecuted the general policy I had. What I mean, I had that specific policy if it match to send an email to one account. The general policy for interface down has another email account as action.
When the interface changed state it only send email to the general policy.
What I then did is in the event policy I removed the source object and add a filtering script.
What I've written down is:

IF ((($node ==Node-Name) && ($object == Interface-Name)) || (($node == Node-Name) && ($object == Interface-Name)))

well this works fine as I want, it sends email on both email addresses as I want but netxms gives me a Minor Alarm.
Event: SYS_SCRIPT_ERROR
message :Script(EPP::6) execution error: Error 11 in line 1:Function not found


Do you have any idea why this is an error as function not found, despite the fact the the policy works fine.
Also why the policy does not work when I select the source objects from the Source object field

Thank you in advance


1st Problem Found:
the function should be in lowercases: if
if ((($node ==Node-Name) && ($object == Interface-Name)) || (($node == Node-Name) && ($object == Interface-Name)))

Well I speaked too soon, the problem is now that for whatever interface that gets down the second emails gets all alerts, so it does not work as expected

Found the solution:
if (($1 == Interface-ID)||($1 == Interface-ID)||($1 == Interface-ID)) return true;
return false;

So now it works as it should.
When on those interfaces it sends on both emails, on every other interface it sends only on the general email