Skip to content

Pushing development changes to production #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
91 changes: 40 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,66 +26,55 @@ System Guard is a Flask app designed to monitor server stats such as CPU, Memory

## Installation 🛠️

check the [Installation.md](/src/docs/installation.md) file for installation instructions.
Check the [Installation.md](/src/docs/installation.md) file for installation instructions.

## How does installation work? 🤔

## Email Feature 📧
The installation process is straightforward and can be completed in a few steps. The user needs to run a bash script that installs the required dependencies, sets up the database, create a conda environment, and add flask server to the cron job. The user can then access the SystemGuard web interface by visiting the server's IP address or domain name.

| Email Alert | Is implemented | who will get the email |
| ----------- | -------------- | ---------------------- |
| Process Killed | Yes | Logged User |
| Login | Yes | Admin User and Logged User |
| Logout | Yes | Logged User |
| Signup | Yes | Admin User & signed up User |
| Create User | Yes | Admin User & Created User |
| Delete User | No | Admin User & Deleted User |
| Speed Test | Yes | Logged User |
| Server Up | Yes | Admin User |
| Notification Settings Change | Yes | Admin User |
| Signup | Yes(few changes required) | Admin User & Logged User |
| Website Monitoring | Yes | Input Email |
| Server Down | No | Admin User |
| Server Up | No | Admin User |
## Email Feature 📧

| Email Alert | Is implemented | who will get the email |
| ---------------------------- | ------------------------- | --------------------------- |
| Process Killed | Yes | Logged User |
| Login | Yes | Admin User and Logged User |
| Logout | Yes | Logged User |
| Signup | Yes | Admin User & signed up User |
| Create User | Yes | Admin User & Created User |
| Delete User | No | Admin User & Deleted User |
| Speed Test | Yes | Logged User |
| Server Up | Yes | Admin User |
| Notification Settings Change | Yes | Admin User |
| Signup | Yes(few changes required) | Admin User & Logged User |
| Website Monitoring | Yes | Input Email |
| Server Down | No | Admin User |
| Server Up | No | Admin User |

## Product Screenshots 📸

### HomePage

![HomePage](/src/static/images/dashboard.png)

### CPU Stats

![CPU Stats](/src/static/images/cpu.png)

### Memory Stats

![Memory Stats](/src/static/images/memory.png)

### Disk Stats

![Disk Stats](/src/static/images/disk.png)

### Speed Test
Check the product screenshots [here](/src/docs/README.md).

![Speed Test](/src/static/images/speedtest.png)

## Why not use a Docker image?

A Docker image has not been created for this project because it requires access to the host machine in order to retrieve server stats. Therefore, it is not possible to obtain server stats from within a Docker container.

## Upcoming Features 📅

- Receive notifications when system metrics cross predefined thresholds.
- Customizable dashboards for personalized server monitoring.
- Plugin support to enhance and extend SystemGuard's functionality.
- Generate and manage server logs for better tracking and troubleshooting.
- Monitor disk read/write speeds for performance insights.
- Check the current firewall status to ensure security.
- A dedicated website monitoring page for tracking uptime and performance.
- Track and save total network data sent/received in the database for data usage monitoring.
- Improve website monitor, save data in database with timestamp to show the history of the website.
- Key-combinding to navigate through the website.
| Feature | Stattus |
| ----------------------------------------------------------------------- | ------- |
| Receive notifications when system metrics cross predefined thresholds | pending |
| Customizable dashboards for personalized server monitoring | pending |
| Plugin support to enhance and extend SystemGuard's functionality | pending |
| Generate and manage server logs for better tracking and troubleshooting | pending |
| Monitor disk read/write speeds for performance insights | pending |
| Check the current firewall status to ensure security | pending |
| A dedicated website monitoring page for tracking uptime and performance | pending |
| Track and save total network data sent/received in the database | pending |
| Improve website monitor, save data in database with timestamp | pending |
| Key-combinding to navigate through the website | pending |
| Support for more server stats like GPU, etc. | pending |
| Support for more Linux distros | pending |

## Learnings 📖

Expand All @@ -98,10 +87,10 @@ A Docker image has not been created for this project because it requires access

## Acknowledgments

| Project | License | Repository |
| -------------- | ------------------- | ----------------------------------------------- |
| `speedtest-cli`| Apache License 2.0 | [GitHub repository](https://github.com/sivel/speedtest-cli) |
| `psutil` | BSD 3-Clause License| [GitHub repository](https://github.com/giampaolo/psutil) |
| `flask` | BSD 3-Clause License| [GitHub repository](https://github.com/pallets/flask) |
| `chart.js` | MIT License | [GitHub repository](https://github.com/chartjs/Chart.js) |
| Project | License | Repository |
| --------------- | -------------------- | ----------------------------------------------------------- |
| `speedtest-cli` | Apache License 2.0 | [GitHub repository](https://github.com/sivel/speedtest-cli) |
| `psutil` | BSD 3-Clause License | [GitHub repository](https://github.com/giampaolo/psutil) |
| `flask` | BSD 3-Clause License | [GitHub repository](https://github.com/pallets/flask) |
| `chart.js` | MIT License | [GitHub repository](https://github.com/chartjs/Chart.js) |

10 changes: 4 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from src.config import app
from src import routes
from src.thread_process import monitor_settings, start_website_monitoring
from src.background_task import start_website_monitoring, monitor_settings

# background thread to monitor system settings changes
# monitor_settings() # Starts monitoring for system logging changes
# start_website_monitoring() # Starts pinging active websites
monitor_settings() # Starts monitoring for system logging changes
start_website_monitoring() # Starts pinging active websites

if __name__ == "__main__":

# Run the Flask application
app.run(host="0.0.0.0", port=5000, debug=True)
app.run(host="0.0.0.0", port=5000, debug=False)
Loading