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.

Scheduling Oh Scheduling Script based Monitors

Hi Thwack Collective,

I need some advice and to see what other people are doing in a particular scenario around monitoring Lambda functions through the Cloud Watch API.

A little bit of back ground:   I wrote a PowerShell script that connects to a specific AWS account and pulls the 4 exposed cloudwatch metrics for lambda functions if there are datapoints in during the 5 minute window that the script is looking at.  if there are no datapoint a -1 value is returned.  While the PowerShell script works well, the lambda functions by definition don't always run every 5 minutes/10 minutes/ x minutes, but are triggered based on other things like files being added to an S3 bucket.

My question or ask is the following:

With SolarWinds limited scheduling capabilities, how does the thwack collective set up monitoring for a lambda function that is running for 2 hours every morning on the hour?  Additionally, how would the thwack collective set up monitoring on a lambda function that is triggered based and could run at any point in time?

I really wish that there was the ability to schedule monitors to run at a certain time as opposed to being polled.

Thanks,

Steve H.

  • hallstev5  wrote:

    Hi Thwack Collective,

    I need some advice and to see what other people are doing in a particular scenario around monitoring Lambda functions through the Cloud Watch API.

    A little bit of back ground:   I wrote a PowerShell script that connects to a specific AWS account and pulls the 4 exposed cloudwatch metrics for lambda functions if there are datapoints in during the 5 minute window that the script is looking at.  if there are no datapoint a -1 value is returned.  While the PowerShell script works well, the lambda functions by definition don't always run every 5 minutes/10 minutes/ x minutes, but are triggered based on other things like files being added to an S3 bucket.

    My question or ask is the following:

    With SolarWinds limited scheduling capabilities, how does the thwack collective set up monitoring for a lambda function that is running for 2 hours every morning on the hour?  Additionally, how would the thwack collective set up monitoring on a lambda function that is triggered based and could run at any point in time?

    I really wish that there was the ability to schedule monitors to run at a certain time as opposed to being polled.

    Thanks,

    Steve H.

    Hi Steve!

    This is a fantastic feature request, could you perhaps add that here? Server & Application Monitor Feature Requests

    Also, would you be willing to share your powershell script with the community?

    Here's a top of the head (no vetting out) proposal for your scenario:

    One possibility is to set up a powershell component to poll and monitor for the trigger (e.g. file added to S3 bucket), and then build an alert for that component as the trigger condition. using the alerting engine you have access to more scheduling capabilities.

    pastedImage_3.png

    and then the alert action would be to then run your powershell script.

    using that kind of workflow would miss out on storing the data for historical tracking, but you'd at least limit how many times you're running the powershell script to grab the metrics when you're looking for them.

  • Hi Serena,

    Thank you for your response.  Scheduling a script monitor has been added as a feature request in SAM a few times.  I know because I always up vote the request.  For some reason people don't want the flexibility of being able to check for a file at a specific time or run a monitor for a specific amount of time (like a 2 hour windows at 1 AM).  Other tools we use have this functionality and our clients take full advantage of it. 

    Using an alert action to run the script for the lambda function would give me the ability to generate another alert if the lambda function generated an error.  Unfortunately, I need to store the data for historical purposes and troubleshooting purposes.

    Yes, when i have time, i will do a write up on the script i wrote for cloudwatch metrics and the script i wrote for Azure Managed SQL or just Azure Monitor metrics.

  • There is a simple way to make a SAM monitor more scheduled.  Designed this a while ago, for a monitor/clean-up script to run on our servers.  Basically to clean up temp files, admin user profiles when not used for a few months, etc.

    1. Schedule the monitor as high a resolution as you need.   
    2. Configure with a param, the times you do or do not want the script to run

    Every time the script runs, it will check and write a file first, then if the time is within the windows it should actually run, kick off the monitoring task.  Optionally you may return the value the script ran last time, or return 0 indicating nothing has been done.  (the latter is for what we are doing in clearing rubbish files, as the number is the storage space saved - and repeating the same number would mess up the stats for how much space is saved per day)

    I guess I should write something up on this as a topic soon...  if the above is unclear shoot me a message.