instance-scheduler-on-aws icon indicating copy to clipboard operation
instance-scheduler-on-aws copied to clipboard

Group by warring/error message to a single SNS event & a SNS event for successful stop start recourse

Open aMfM9E2 opened this issue 3 years ago • 2 comments

Hi,

I am using the instance scheduler for managing ec2 recourses on around 2x aws accounts, for some cause the ec2 is not tagged as it is not require for stop/start and the function will return a warning say "schedule name "1111"/"0000" is unknown" and send out a email by each warning message. so every hour I will receive around 4xx email for the warning message.

Is that possible to group by the warning message in a one email and also add the event after successful stop start?

aMfM9E2 avatar Jun 04 '21 08:06 aMfM9E2

@aMfM9E2 You can choose to update the logger.py file to write some filter conditions based on your requirement.

    def warning(self, msg, *args):
        """
        Logs warning message
        :param msg: Warning message format string
        :param args: parameters
        :return:
        """
        s = self._emit(LOG_LEVEL_WARNING, msg, *args)

        #Update the code here to filter out message(s) based on a format.
        self.publish_to_sns("Warning", s)

Apart from making the above change, there is no workaround for aggregating similar type of warning messages, I will add a new feature in the backlog to be prioritized for a future release.

gockle avatar Jun 07 '21 19:06 gockle

@gockle , thanks for the reply, that perfect if in the future can provide difference logging level for sns like successful list, warning list etc... instance scheduler is a very cool solution for cross account operation, can't wait for next release and more new functions

aMfM9E2 avatar Jun 08 '21 01:06 aMfM9E2