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