Forum Discussion

birchall's avatar
birchall
Icon for Neophyte rankNeophyte
2 months ago
Solved

Alert if other datapoint = x

Hey folks, 

I have a custom Powershell script, that effectively returns 2 results. 

DaysRemaining
    Returns any integer value
    This datapoint alerts when there is <=30 days remaining 

InUse
    Returns Boolean 0/1 (0=not in use / 1=in use).

I am wondering how I can surpess the DaysRemaining alert, when the the "InUse" datapoint returns 0 (not in use)

Any help greatly appreciated. 

  • You can use Complex Datapoints that has an IF expression that can return a different value depending on the InUse state. You would then setup thresholds on this datapoint instead of the original DaysRemaining. There are several built-in Datasources that do this, like AWS_EC2 and AWS_Connect.

    So something like this (did not test): if(eq(InUse,1),DaysRemaining,unkn()) , which you can then name "DaysRemainingIfInUse" or the like.

2 Replies

  • You can use Complex Datapoints that has an IF expression that can return a different value depending on the InUse state. You would then setup thresholds on this datapoint instead of the original DaysRemaining. There are several built-in Datasources that do this, like AWS_EC2 and AWS_Connect.

    So something like this (did not test): if(eq(InUse,1),DaysRemaining,unkn()) , which you can then name "DaysRemainingIfInUse" or the like.