This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL trigger actions

FormerMember
FormerMember

I've created a Custom SQL Alert trigger condition on IPAM nodes which looks like this:

select IPAM_NodeReportView.IPAddress, IPAM_NodeReportView.IPNodeId from IPAM_NodeReportView WHERE ipnodeid in (SELECT a.ipnodeid FROM IPAM_IPHistoryReport a INNER JOIN (SELECT ipnodeid, max(IPAM_IPHistoryReport.Time) as tt from IPAM_IPHistoryReport Group by ipnodeid) b on a.IPNodeId=b.IPNodeId and a.Time > dateadd(minute, -100, GetDate()) where (a.FromValue='Available' and a.IntoValue='Used') or (a.FromValue='Available' and a.IntoValue='Reserved'))

The SQL works, the alert is triggered and it will detect a status change of an IP in IPAM.

Eventually, I would like to run a powershell program that will use the IPs from the above query. I've started with sending myself an email with the exact query in the message.

But the mail I get is:

MACRO SQL ERROR - String cannot be of zero length.

Parameter name: oldValue