From 0d1ba043e989c24017c130347ff626877b022b2b Mon Sep 17 00:00:00 2001 From: pavan Date: Mon, 20 Jul 2026 20:14:23 +0530 Subject: [PATCH 1/2] Added some line to the shell script in comments --- github-api-integration-module.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-api-integration-module.sh b/github-api-integration-module.sh index d94d2951..409329f7 100644 --- a/github-api-integration-module.sh +++ b/github-api-integration-module.sh @@ -8,7 +8,7 @@ # This script will help users to communicate and retrieve information from GitHub # Usage: # Please provide your github token and rest api to the script as input -# +# Added some text # ################################ From 89df3728ee4d94c6d32f1778c94e11fa14b3e452 Mon Sep 17 00:00:00 2001 From: pavankumarvellanki Date: Mon, 20 Jul 2026 21:06:44 +0530 Subject: [PATCH 2/2] Basic python script for CPU alerts This script was created to send a mail when the CPU is raised above 80%. --- Basic-python-program.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Basic-python-program.py diff --git a/Basic-python-program.py b/Basic-python-program.py new file mode 100644 index 00000000..55517250 --- /dev/null +++ b/Basic-python-program.py @@ -0,0 +1,19 @@ +import smtplib +import psutil + +# 1. Check the CPU usage +cpu_usage = psutil.cpu_percent(interval=1) + +# 2. Trigger email if it exceeds the limit +if cpu_usage > 80.0: + # Setup the connection + server = smtplib.SMTP('://gmail.com', 587) + server.starttls() + server.login('abc@gmail.com', 'password') + + # Send the raw message + subject = "Subject: CPU Alert\n\n" + body = f"CPU usage is high: {cpu_usage}%" + server.sendmail('abc@gmail.com', 'owner_of_vm@gmail.com', subject + body) + + server.quit()