# Slack - Alert Integration - Node Memory

Version 5

This article shows how to setup this script as an alert action. Please take time to review the main overview article if you have not already done so: Slack Alert Integration - Overview . The main overview article contains information necessary to completely setup this script.

This script is specifically designed for node based alerts. I also included a screenshot of the alert condition too.

In the Trigger Actions I added 'Execute an External Program' action.

This is the full text in the 'Network path to external program' field.

• C:\windows\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy unrestricted -command "<C:\path\to\script>\Slack_Alert_Trigger_Action_Node_Memory.ps1 '${N=SwisEntity;M=DisplayName}' '${N=SwisEntity;M=Stats.PercentMemoryUsed}' '${N=SwisEntity;M=MemoryUsed}' '${N=SwisEntity;M=PercentMemoryUsedThreshold.IsLevel1State}' '${N=SwisEntity;M=PercentMemoryUsedThreshold.IsLevel2State}' '${N=Alerting;M=AlertDetailsUrl}' '${N=SwisEntity;M=DetailsUrl}' '${N=Alerting;M=AcknowledgeUrl}' '${N=Generic;M=DateTime;F=OriginalValue}'" **You will need to update the <C:\path\to\script> in the above line to the location that you have the script saved.** I'm passing in the following Orion variables: • Node Name:${N=SwisEntity;M=Node.DisplayName}
• Percent Memory Used: ${N=SwisEntity;M=Stats.PercentMemoryUsed} • Current Memory Usage:${N=SwisEntity;M=MemoryUsed}
• Memory Warning Value Reached: ${N=SwisEntity;M=PercentMemoryUsedThreshold.IsLevel1State} • Memory Critical Value Reached:${N=SwisEntity;M=PercentMemoryUsedThreshold.IsLevel2State}
• Alert Details Page: ${N=Alerting;M=AlertDetailsUrl} • Node Details Page:${N=SwisEntity;M=DetailsUrl}
• Auto Acknowledge URL: ${N=Alerting;M=AcknowledgeUrl} • Orion Date/Time:${N=Generic;M=DateTime;F=OriginalValue}

Once that alert action is completed then copy it to Reset Actions.

Finish editing the alert and you should be done.

**Change Log**

• 2016-03-18 : Initial release