i have a question about omnibus triggers. i used this triggers to send an email if there are any event match the filter.
here is the filter:
begin
for each row critical in alerts.status where critical.Severity = 5 and
critical.Grade <= 6 and critical.LastOccurrence <= ( getdate() - (60*30) )
begin
execute send_email( critical.Node, critical.Severity, 'test2@npp.local','Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;
end
i successfully sent an email with that triggers above,
i want to add a few lines to that triggers, it would be look like this:
begin
for each row critical in alerts.status where critical.Severity = 5 and
critical.Grade <= 6
if critical.Situation = 'blabla1'
{begin
execute send_email( critical.Node, critical.Severity, 'test2@npp.local','Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;}
if critical.Situation = 'blabla2'
{begin
execute send_email2( critical.Node, critical.Severity, 'test2@npp.local', 'Netcool Email', critical.Summary, 'WINITMSVR631');
update alerts.status via critical.Identifier set Grade=7;
end;}
end
but i always get some error with that. honestly i barely know about sql programming.
any advise
thank you for your help