Menu-Based System Health Check Script

Menu-Based System Health Check Script

What It Does:

This tool provides a menu-driven interface where users can choose from the following options:

? Check Disk Usage: See how much disk space is being used.

? Check Memory Usage: Monitor RAM utilization.

? Check CPU Usage: Track CPU performance.

? Monitor Top 20 Running Services: Display the top 20 running services.

? Send Email Report: Compile a detailed health report and send it via email.

? Exit: Close the program.

It’s a continuous process, so users can keep checking their system health without restarting the tool.

[Image 1: Menu Based Health check]

"Here’s the menu-driven interface of the System Health Checker Tool. Users can choose from 6 options to monitor their system health!

Why I Built It:

This project was part of a challenge shared by Sagar Utekar (thank you for the inspiration! ??). I wanted to create a tool that simplifies system monitoring and automates the process of sending health reports. It’s a great way to stay on top of system performance without manual checks.

Challenges I Faced:

1?? Email Automation: Gmail’s security restrictions initially blocked my script from sending emails. I solved this by generating an App Password.

2?? Error Handling: Ensuring the script handled errors gracefully (e.g., if a service failed or email sending failed).

3?? User-Friendly Interface: Creating a menu-driven interface so users can easily interact with the tool.

[Image 2: Health Check Output]

"Here’s an example of the output when checking disk usage. The tool provides real-time insights into system performance!"

What I Learned:

  • How to use Python libraries like psutil for system monitoring and smtplib for email automation.
  • The importance of environment variables to securely store sensitive information like email credentials.
  • How to structure a project for scalability and readability.

Why This Matters:

This tool is a great example of how Python can be used for automation and system monitoring. It’s a practical solution that can be used in daily workflows to keep systems healthy and efficient.

[Image 3: Email Report]

"The tool also sends a detailed email report with all the health check data. Here’s what it looks like!"


?? GitHub Repository: https://github.com/AtifGit25/system-health-check

Feel free to check out the code, fork it, or suggest improvements! I’d love to hear your thoughts. ??

?? Hashnode Blog: https://menu-based-system-health-check-script.hashnode.dev/menu-based-system-health-check-script

A big shoutout to Sagar Utekar for sharing this challenge—it was a fantastic learning experience! ??

#Python #Automation #SystemMonitoring #OpenSource #LearningInPublic #CodingJourney #GetFitWithSagar #SRELife #DevOps

要查看或添加评论,请登录

社区洞察

其他会员也浏览了