avivk9 / AWS_anomaly_detection

SPOT 2022 - COLMAN HACKATHON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS_anomaly_detection

Collaborators

Background

Made as a part of Hackathon in College Of Management & Spot by NetApp
We were given a problem: Detect CPU anomalies from aws server and analyze them
(also dealt with SQL Injections problem)

The AWS Server

We created an AWS machine and upload their 2 different programs
One that will demonstrate usual and normal usage
And another that will demonstrate unusual extreme usage

The Communication

Using Python and BOTO3 module we communicated with the AWS server and got information about
the CPU utilization with possibilities to achieve more metrics in the future - code.

Analyze The Data Given

With the data came from the BOTO3 responses we created a server status.
Claim: The status calculation was based on guesses and unreliable methods

def detect(utilizations):
    last = len(utilizations) - 1
    # 0 usage
    if utilizations[last] <= 1 and utilizations[last - 1] <= 1 and utilizations[last - 2] <= 1:
        return "empty_server"
    # low usage
    if utilizations[last] <= 30 and utilizations[last - 1] <= 30 and utilizations[last - 2] <= 30:
        return "change_server_host"
    # calculate m
    m = utilizations[last] - utilizations[last - 1] / utilizations[last - 1] - utilizations[last - 2]

    # high m based on the prev one
    if m >= 2:
        return "hacked"
    # low m based on the prev one
    if m <= -2:
        return "server_cooled_hard"
    # normal
    return "normal_status"

GUI

Using 'Tkinter' and 'Matplotlib' modules we presented the CPU Utilization over Time together with the server status and a refresh button

![pic](C:\Users\Aviv\IdeaProjects\AWS_anomaly_detection\cpu graph.PNG)

pic2

About

SPOT 2022 - COLMAN HACKATHON


Languages

Language:Python 100.0%