SYSTEM RESOURCE MONITOR
BSc COMPUTER SCIENCE
UNIVERSITY INSTITUTE OF TECHNOLOGY
AZHOOR
,
PROJECT REPORT
Submitted by
PRAVEEN R RAJ (32022985007)
Submitted in partial fulfillment of the requirements for the award of BSc (Computer Science) degree of
University of kerala
2024
UNIVERSITY INSTITUTE OF TECHNOLOGY
UNIVERSITY OF KERALA
AZHOOR, THIRUVANANTHAPURAM
CERTIFICATE
Certificated that this report titled "SYSTEM RESOURCE MONITOR" is a banofide work of
project done by Praveen R Raj (32022985007) under my supervision and guidance,
towards partial fulfillment of the requirements for the award of the Degree of BSc (Computer
Science) of University of Kerala.
MRS REJANI T R Dr. A. ABDUL NIZAR
Internet Guide Principal
External Examiner
Date:
ACKNOWLEDGEMENT
We wish to place on record profound indebtedness and
gratitude for all those who have contributed directly or indirectly to
make this project work judicious supervision and guidance, which
helped us on the successful completion of this project a success. At
the very onset, we express our deep gratitude to God Almighty, who
sheltered us under her protective wings and showered on us
enumerable blessings throughout the period of this bachelor
in computer science course.
We are thankful to Dr. A. ABDUL NIZAR, our Principal for
providing us with all facilities for carrying out this project
We highly obliged to MRS. REJANI T R, our internal guide
from College, Department of Computer Science, UIT Azhoor, for
being a source of inspiration throughout the course and to her
valuable guidance.
We are thankful to all the staffs and members of the Computer
Science Department for the encouragement and suggestions. Last
but not the least we thank our parents and friends for their
moral support and encouragement for the successful completion of
this project.
ABSTRACT
The primary goal of this project is to develop a comprehensive system resource
monitoring tool that provides real-time insights into the performance and resource
usage of a computer system. The tool is designed to monitor key system metrics such
as CPU, memory, disk, and GPU usage and display them dynamically in a graphical
user interface (GUI). By leveraging multi-threading and data visualization
techniques, the tool ensures smooth operation and efficient real-time monitoring
without affecting system performance.
System resource monitoring is an essential task for users who want to keep track of
their system's health and performance. Whether for diagnostic purposes, performance
tuning, or general system management, understanding the current usage of system
resources can offer valuable insights into a computer's overall performance. This
project implements a lightweight yet powerful monitoring tool using Python, psutil,
Tkinter, and matplotlib. The application monitors CPU, memory, disk, and GPU
performance in real time, offering an intuitive graphical interface that can display
data trends over time.
This project provides an intuitive, real-time monitoring tool for system resources,
offering key insights into CPU, memory, disk, and GPU usage in a visually appealing
format. By combining efficient resource usage with a responsive interface, the tool is
well-suited for everyday users, system administrators, and developers alike, allowing
them to monitor and maintain optimal system performance. The project's modular
design and multi-threaded architecture make it scalable and adaptable for further
enhancements in the future.
SYSTEM RESOURCE MONITOR
Contents
1. INTRODUCTION.....................................................................................1
2. SYSTEM ANALYSIS...............................................................................2
• 2.1 Existing System........................................................................2
• 2.2 Proposed System......................................................................3
3. SYSTEM REQUIREMENTS...................................................................4
• 3.1 Programming Environment......................................................5
4. FEASIBILITY STUDY.............................................................................8
• 4.1 Introduction ............................................................................8
• 4.2 Technical Feasibility.................................................................9
• 4.3 Operational Feasibility..............................................................9
• 4.4 Economic Feasibility.................................................................9
• 4.5 Legal Feasibility........................................................................10
• 4.6 Time Feasibility
5. SYSTEM DESIGN....................................................................................11
• 5.1 Introduction...........................................................................11
• 5.2 Purpose..................................................................................11
• 5.3 Scope.....................................................................................11
• 5.4 Existing System Challenges..................................................11
• 5.5 Limitations of Traditional System Monitoring Tools...........11
• 5.6 Need for a New System........................................................12
• 5.7 System Architecture.............................................................12
• 5.8 Overview of the Architecture...............................................12
• 5.9 Presentation Layer................................................................12
• 5.10 Logic Layer........................................................................12
• 5.11 Data Layer..........................................................................13
• 5.12 Data Flow Design...............................................................13
• 5.13 Data Flow Overview..........................................................13
• 5.14 Data Flow Diagram (DFD)................................................13
• 5.15 Entity-Relationship Diagram (E-R Diagram)....................15
• 5.16 User Interface Design........................................................18
• 5.17 User Experience Goals......................................................18
• 5.18 User Interface Components...............................................18
• 5.19 Future Enhancements for UI.............................................18
• 5.20 Hardware and Software Requirements..............................18
• 5.21 Hardware Requirements....................................................18
• 5.22 Software Requirements.....................................................19
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR
• 5.23 Security Design..................................................................19
• 5.24 Data Security......................................................................19
• 5.25 Error Handling...................................................................19
• 5.26 Future Security Enhancements...........................................19
• 5.27 System Deployment and Installation..................................19
• 5.28 Installation Process.............................................................19
• 5.29 Deployment Considerations................................................19
• 5.30 Cross-Platform Deployment...............................................19
6. CODING AND IMPLEMENTATION...............................................20
• 6.1 Introduction to Coding and Implementation.........................20
• 6.2 Tools and Libraries Used......................................................20
• 6.3 Program Structure and Design..............................................20
• 6.4 Code Implementation............................................................21
• 6.5 Real-Time Data Updates.......................................................23
• 6.6 Error Handling......................................................................23
• 6.7 Optimization Techniques......................................................24
• 6.8 Testing and Validation.........................................................24
• 6.9 Conclusion...........................................................................24
7. SYSTEM TESTING.............................................................................25
• 1.1 Levels of Testing..................................................................25
• 2 Specific Testing Types............................................................26
• 3 Detailed Testing Process.........................................................27
8. SYSTEM MAINTENANCE................................................................29
• 1.1 Corrective Maintenance.......................................................29
• 1.2 Adaptive Maintenance.........................................................29
• 1.3 Perfective Maintenance........................................................29
• 1.4 Preventive Maintenance.......................................................29
• 2. Maintenance Procedures....................................................... 30
9. SYSTEM SECURITY..........................................................................31
• 1 Types of Security Threats........................................................31
• 2 Security Measures Implemented.............................................32
• 3 Data Security...........................................................................33
• 4 Securing Communication Channels........................................34
• 5 Penetration Testing.................................................................34
10.SOURCE CODE..................................................................................35
11.SCREENSHOTS..................................................................................40
12.BIBLIOGRAPHY................................................................................45
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 1
1.INTRODUCTION
The System Resource Monitor is a Python-based application designed to track and report key
system performance metrics in real-time. This tool enables users to monitor their computer's
resource utilization, helping them understand how hardware components like CPU, memory, and
disk space are being used. By providing insightful and timely information, it aids in maintaining
optimal system performance, diagnosing resource-related issues, and ensuring efficient resource
allocation
Monitoring hardware components enables early detection of potential issues such as disk failure,
overheating, or excessive CPU usage. By analyzing system metrics, users can take preventive
actions like replacing faulty hardware, cleaning up disk space, or enhancing cooling systems before
minor issues lead to significant failures.
This project leverages Python's powerful libraries to gather detailed data about the system's current
status. The key components monitored by the System Resource Monitor include:
• CPU Usage: Tracks the percentage of CPU being utilized, providing real-time insights into
processing load.
• Memory Usage: Monitors RAM usage, helping users understand how much memory is
available and being used by applications.
• Disk Space: Shows disk usage details such as available and used space, giving users a
snapshot of storage consumption.
• Network Activity (if included): Measures the data transfer rates to track network bandwidth
usage.
By utilizing libraries like psutil, this Python program provides an easy-to-use interface with the help
of tkinter that collects and displays resource data in a human-readable format. The System Resource
Monitor is especially useful for system administrators, developers, and users who want to ensure
their computer is running efficiently or diagnose potential performance bottlenecks.
This project can be further extended by incorporating features like graphical dashboards, real-time
alerts, and logging for historical analysis. It offers a flexible foundation for building more
comprehensive system monitoring solutions.
Technologies Used:
• Python: The primary programming language used to implement the system monitoring
functionalities.
• psutil: A Python library used for retrieving information on system utilization (CPU, memory,
disks, network, sensors).
• Other Libraries: Additional modules may include time for scheduling updates, tkinter for
GUI creation (if applicable), or other visualization tools for real-time data display.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 2
2. SYSTEM ANALYSIS
System analysis is a detailed study of various operation performed by a system and their
relationship within and outside of the system. System analysis definition simply means
“figuring out what to make it before”.
System analysis can be categorized into five parts:
System planning and investigation
Information gathering
Applying analysing tools for structured analysis
Feasibility study
Cost/Benefit analysis
2.1 EXISTING SYSTEM
In most cases, PC hardware monitoring and resource analysis are conducted using built-in system
tools or third-party software. While these tools and systems are functional, they often come with
several limitations and drawbacks, especially when looking for an all-encompassing, user-friendly
solution.There is no third-party or built-in software that contains all system analysing features.
Disadvantages:
• Complexity in Setup: Many existing monitoring solutions (e.g., Nagios, Zabbix, and others)
are complex to install and configure, often requiring server-side installation or complex
scripting.
• Resource Intensive: Most professional-grade monitoring tools are resource-hungry. They
consume CPU, memory, and bandwidth, which can affect the performance of the system
they're monitoring.
• Overhead in Centralized Systems: Centralized monitoring systems can create a bottleneck,
where one server manages several devices. This server may become overloaded, introducing
lag and reducing real-time accuracy.
• Lack of Flexibility: Many systems are not user-friendly for those who want customizable
monitoring on a smaller scale. These systems are often designed for network-wide
monitoring, not single-user systems.
• No Real-Time GUI for Local Use: Current monitoring systems often rely on command-line
interfaces or web-based dashboards, which may not be as intuitive for real-time local use.
While some systems have GUIs, they can be clunky and outdated.
• Overloaded with Features: Some systems are loaded with features that go beyond basic
CPU/memory/disk monitoring. This makes the user interface cluttered and complicated for
users who need only basic system monitoring.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR
3
• Platform Dependence: Some monitoring tools are designed for specific operating systems
(Linux, Windows, macOS), lacking cross-platform compatibility, which could limit users
who operate in hybrid environments.
2.2 Proposed System
Advantages:
• Lightweight and Simple to Use: Your program (based on psutil and tkinter) is lightweight
and designed for single-user systems, making it easy to install and configure without extra
dependencies or overhead. This makes it perfect for local system monitoring.
• Real-Time GUI: Your program can display real-time statistics using a graphical user
interface (GUI), which is easier for non-technical users to understand compared to
command-line tools or web-based dashboards. The use of tkinter ensures simplicity and
responsiveness in the user interface.
• Focused Monitoring: Your system focuses on critical metrics such as CPU usage, memory
usage, disk usage, GPU usage, and temperatures. This removes unnecessary complexity and
gives users exactly what they need without a cluttered interface.
• Customizability and Flexibility: Being a Python-based solution, the system is easy to modify
and customize. If the user needs to add additional monitoring features (e.g., network
bandwidth usage, specific process monitoring), they can do so easily by extending the
Python code.
• Cross-Platform Compatibility: With Python's portability, this system can run on multiple
operating systems, including Windows, Linux, and macOS, without the need for significant
changes to the codebase.
• Low Resource Usage: The program's low footprint ensures that system resources are not
heavily taxed, allowing users to monitor their systems without sacrificing performance.
psutil is known for being efficient, and tkinter is a lightweight GUI library.
• Built-In Temperature Monitoring: Many existing systems either require third-party drivers or
are unable to monitor CPU core-specific temperatures, especially on consumer machines. By
integrating this feature, This program offers something more useful for users with a focus on
system health.
Disadvantages:
• Limited to Local Systems: While ideal for local machine monitoring, this system cannot
monitor multiple devices or networked systems, unlike more advanced enterprise-level
solutions.
• Basic Features Only: This system is limited to monitoring core metrics (CPU, memory, disk,
etc.). More advanced features (such as alerting, logging, or remote access) would need to be
added for more complex use cases.
• Graphical Interface Simplicity: tkinter is useful for basic UIs but lacks advanced graphical
capabilities. Users may require more dynamic, visually-appealing interfaces, which would
require the integration of more powerful GUI libraries.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 4
3.System Requirements
Component Minimum Requirement Recommended Requirement
Processor (CPU) Dual-core (Intel i3/AMD Ryzen 3) Quad-core (Intel i5/AMD Ryzen 5) or better
Memory (RAM) 2 GB 8 GB or more
Storage (Disk) 50 MB for Python and dependencies SSD preferred, 500 MB free space
Dedicated GPU (NVIDIA/AMD) for detailed
Graphics Card (GPU) Basic GPU support
monitoring
Windows 10, Ubuntu 20.04+, macOS
Operating System Windows 7/8/10, Linux, macOS
Catalina+
Python Version Python 3.6 or newer Python 3.10+ recommended
Libraries psutil, tkinter psutil, tkinter, GPUtil for GPU monitoring
Additional Tools Python IDE or Text Editor VSCode, PyCharm, or Sublime Text
Network Not required For updates and remote monitoring, if added
System requirements are a list of the hardware and software components needed for a program or game to run
smoothly.
To ensure optimal performance and compatibility, please refer to the following system requirements for
[System Resource Monitor]. The minimum requirements are sufficient for basic functionality, while the
recommended requirements are ideal for a seamless and enhanced user experience. Please note that these
specifications may vary depending on specific configurations and usage patterns.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 5
3.1 PROGRAMMING ENVIRONMENT
Overview of python
Python is a high-level, interpreted scripting language developed in the late 1980s by Guido van
Rossum at the National Research Institute for Mathematics and Computer Science in the
Netherlands. The initial version was published at the alt sources newsgroup in 1991, and version 1.0
was released in 1994.
Python 2.0 was released in 2000, and the 2.x versions were the prevalent releases until December
2008. At that time, the development team made the decision to release version 3.0, which contained
a few relatively small but significant changes that were not backward compatible with the 2.x
versions. Python 2 and 3 are very similar, and some features of Python 3 have been back ported to
Python 2. But in general, they remain not quite compatible.
Both Python 2 and 3 have continued to be maintained and developed, with periodic release updates
for both. As of this writing, the most recent versions available are 2.7.15 and 3.6.5. However, an
official End Of Life date of January 1, 2020 has been established for Python 2, after which time it
will no longer be maintained. If you are a newcomer to Python, it is recommended that you focus on
Python 3, as this tutorial will do.
Python is still maintained by a core development team at the Institute, and Guido is still in charge,
having been given the title of BDFL (Benevolent Dictator For Life) by the Python community. The
name Python, by the way, derives not from the snake, but from the British comedy troupe Monty
Python’s Flying Circus, of which Guido was, and presumably still is, a fan. It is common to find
references to Monty Python sketches and movies scattered throughout the Python documentation.
Python is Popular:
Python has been growing in popularity over the last few years. The 2018 Stack Overflow
Developer Survey ranked Python as the 7th most popular and the number one most wanted
technology of the year. World-class software development companies around the globe use Python
every single day. According to research by Dice Python is also one of the hottest skills to have and
the most popular programming language in the world based on the Popularity of Programming
Language Index. Due to the popularity and widespread use of Python as a programming language,
Python developers are sought after and paid well.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 6
Python is Interpreted:
Many languages are compiled, meaning the source code you create needs to be translated into
machine code, the language of your computer’s processor, before it can be run. Programs written in
an interpreted language are passed straight to an interpreter that runs them directly. This makes for a
quicker development cycle because you just type in your code and run it, without the intermediate
compilation step. One potential downside to interpreted languages is execution speed. Programs that
are compiled into the native language of the computer processor tend to run more quickly than
interpreted programs. For some applications that are particularly computationally intensive, like
graphics processing or intense number crunching, this can be limiting. In practice, however, for
most programs, the difference in execution speed is measured in milliseconds, or seconds at most,
and not appreciably noticeable to a human user. The expediency of coding in an interpreted
language is typically worth it for most applications.
Python is Free:
The Python interpreter is developed under an OSI-approved open-source license, making it free to
install, use, and distribute, even for commercial purposes. A version of the interpreter is available
for virtually any platform there is, including all flavors of Unix, Windows, macOS, smartphones
and tablets, and probably anything else you ever heard of. A version even exists for the half dozen
people remaining who use OS/2.
Python is Portable:
Because Python code is interpreted and not compiled into native machine instructions, code written
for one platform will work on any other platform that has the Python interpreter installed. (This is
true of any interpreted language, not just Python.)
Python is Simple:
As programming languages go, Python is relatively uncluttered, and the developers have
deliberately kept it that way. A rough estimate of the complexity of a language can be gleaned from
the number of keywords or reserved words in the language. These are words that are reserved for
special meaning by the compiler or interpreter because they designate specific built-in functionality
of the language.
Python 3 has 33 keywords, and Python 2 has 31. By contrast, C++ has 62, Java has 53, and Visual
Basic has more than 120, though these latter examples probably vary somewhat by implementation
or dialect. Python code has a simple and clean structure that is easy to learn and easy to read. In
fact, as you will see, the language definition enforces code structure that is easy to read.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 7
Overview of VS CODE – IDE
Visual Studio Code combines the simplicity of a source code editor with powerful developer
tooling, like IntelliSense code completion and debugging. First and foremost, it is an editor that gets
out of your way. The delightfully frictionless edit-build-debug cycle means less time fiddling with
your environment and more time executing on your ideas.
At its heart, Visual Studio Code features a lightning fast source code editor, perfect for day-to-day
use. With support for hundreds of languages, VS Code helps you be instantly productive with
syntax highlighting, bracket-matching, auto-indentation, box-selection, snippets, and more. Intuitive
keyboard shortcuts, easy customization and community contributed keyboard shortcut mappings let
you navigate your code with ease.
For serious coding, you'll often benefit from tools with more code understanding than just blocks of
text. Visual Studio Code includes built-in support for IntelliSense code completion, rich semantic
code understanding and navigation, and code refactoring. And when the coding gets tough, the
tough get debugging. Debugging is often the one feature that developers miss most in a leaner
coding experience, so we made it happen. Visual Studio Code includes an interactive debugger, so
you can step through source code, inspect variables, view call stacks, and execute commands in the
console.
VS Code also integrates with build and scripting tools to perform common tasks making everyday
workflows faster. VS Code has support for Git so you can work with source control without leaving
the editor including viewing pending changes diffs.
Python Version:
• python 3.6 or newer(Python 3.10+ recommended)
Required Python libraries:
• psutil: Provides access to system details such as CPU, memory, disk, and process
information.
• tkinter: Built-in Python library for creating GUIs. No need for installation, but it must be
enabled on some systems.
• GPUtil: Used for GPU monitoring on systems with NVIDIA or AMD GPUs.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 8
4.Feasibility Study
4.1. Introduction
• Overview of the Project: The proposed system monitoring program is designed to track
various system metrics such as CPU usage, memory usage, disk usage, GPU usage, and
CPU core-specific temperatures. It uses Python's psutil library for gathering system
information and tkinter to create a simple, user-friendly graphical interface. The program
aims to provide real-time monitoring for both casual and technical users, helping them
understand system performance and detect potential issues early.
• Objective of the Feasibility Study: This study aims to determine whether the system
monitoring program is feasible from technical, operational, and economic perspectives. It
will assess the viability of developing, deploying, and maintaining the program, and whether
the resources required align with the benefits provided.
4.2. Technical Feasibility
• Technology Used: The program relies primarily on Python, a widely-used programming
language known for its simplicity and readability. The core functionality is built using the
psutil library, which provides access to detailed system information such as CPU, memory,
disk, and network usage. For the graphical user interface (GUI), the program uses tkinter, a
built-in Python library, which makes the application lightweight and easy to deploy without
requiring additional external libraries.
The program also optionally supports GPU monitoring, which can be implemented using the
GPUtil library. This makes it flexible and adaptable to systems that require GPU
performance tracking, such as gaming PCs or workstations used for machine learning tasks.
• Platform Compatibility: The program is cross-platform, meaning it can run on Windows,
Linux, and macOS with little to no modification. This is because both psutil and tkinter are
supported on all major operating systems. However, certain features like temperature
monitoring might require additional setup on specific platforms, such as lm-sensors on
Linux for accessing hardware sensors.
• Hardware Requirements: The program has modest hardware requirements, making it
accessible to a wide range of users. It can run on any modern dual-core CPU with at least 2
GB of RAM, though higher system specifications are recommended for users monitoring
multiple processes or using GPU-intensive tasks. Disk space usage is minimal, requiring less
than 100 MB for installation and operation.
• Development Tools: Development of the program requires minimal resources. Python's
open-source ecosystem, combined with free-to-use Integrated Development Environments
(IDEs) such as VSCode, PyCharm, or Sublime Text, ensures that development can proceed
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 9
at little to no cost. The program's modularity and reliance on Python libraries make it easy to
extend and modify over time.
• Scalability: While the program is designed for individual systems, its architecture allows for
future scalability. With some modifications, it could be adapted to monitor multiple systems
over a network or integrated with cloud-based monitoring solutions. However, in its current
form, the program is best suited for local system monitoring.
• Challenges: The main technical challenges include ensuring compatibility with all hardware
platforms, especially when monitoring temperature sensors, and optimizing the performance
for low-resource systems. Additionally, integrating advanced features such as real-time alerts
or logging may require additional effort and libraries, which could increase the complexity
of the project.
4.3. Operational Feasibility
• User Requirements: The system monitoring program is designed to meet the needs of a
broad range of users, from casual users who want to check their system's health to IT
professionals and system administrators who need detailed performance metrics. The
program's simplicity and intuitive design make it easy for non-technical users to operate,
while the detailed metrics provided will appeal to power users.
• User Interface (UI) Simplicity: The program uses tkinter to build a simple and clean
graphical interface. The interface includes clear labels, buttons, and charts, making it easy
for users to access relevant information at a glance. Unlike more complex system
monitoring tools, this program focuses on clarity and ease of use, avoiding unnecessary
features that could overwhelm users.
• Ease of Maintenance: Since the program is written in Python, an easy-to-learn and widely-
adopted language, it is simple to maintain and update. With the help of Python's vast online
community and the support for its libraries, resolving bugs or adding new features can be
done efficiently. Additionally, the program's reliance on well-documented libraries such as
psutil ensures that future updates or changes to the underlying system monitoring methods
will be manageable.
• Training: Minimal to no training is required for users to operate the system. The intuitive
interface and basic functionality mean that users can start using the program immediately
without any special knowledge. If required, a simple user manual or tutorial could be
provided to help users understand how to read system metrics and interpret performance
data.
4.4. Economic Feasibility
• Development Cost: The development of the program incurs minimal cost due to the use of
open-source technologies. Python, along with its libraries (psutil, tkinter), is free to use.
There are no license fees, and the program can be developed entirely using free software.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 10
This makes the project economically feasible, especially for small organizations or
individual developers who may have limited budgets.
• Maintenance Cost: The program’s maintenance cost is also minimal. Python’s popularity
ensures that there are ample resources available for troubleshooting, and updates to libraries
like psutil are released regularly. Since the program does not rely on any expensive third-
party services or tools, ongoing costs are limited to developer time for bug fixes and feature
enhancements.
• Cost of Hardware and Software: There is no need for additional hardware beyond the
minimum system requirements, which means users don’t need to invest in expensive
upgrades. Furthermore, since all the software components are open-source, there are no
upfront costs for purchasing or licensing software. Users only need a system capable of
running Python and the necessary libraries.
• Return on Investment (ROI): The program can provide significant savings in terms of
preventing system crashes, detecting performance issues early, and reducing system
downtime. For businesses or IT professionals, these benefits translate directly into financial
savings, as improved system performance leads to increased productivity and fewer
technical problems.
4.5. Legal Feasibility
• Licensing: The program uses open-source libraries, all of which are distributed under
permissive licenses such as MIT or BSD. This means the program can be freely distributed,
modified, and used for both personal and commercial purposes without legal constraints. It
is essential, however, to adhere to the terms of these licenses, particularly regarding
attribution and modification.
• Data Privacy: Since the program only monitors system performance metrics and does not
collect or transmit personal data, privacy concerns are minimal. The program does not need
to comply with stringent data protection regulations, such as GDPR, since it operates
entirely on the local system and does not interact with sensitive user data.
4.6. Time Feasibility
• Development Time: The development time for the program is relatively short, given the
simplicity of its design and the availability of pre-built libraries like psutil and tkinter.
Depending on the specific features implemented, the core functionality of the program can
be developed within a few weeks. Additional features, such as more advanced GPU
monitoring or multi-system capabilities, would require more time.
• Implementation Timeline: The program can be installed and operational within minutes on
a standard system. Users only need to install Python and the necessary libraries (psutil and
tkinter), which can be done using a few simple commands. No extensive setup is required,
making the program easy to deploy across multiple systems.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 11
5.System Design
5.1 Introduction
In the current landscape of increasing technological complexity, real-time system monitoring has
become a crucial aspect of maintaining system performance and preventing failures. This system
design document provides a detailed architecture and component-based design of a system
monitoring application developed using Python. The goal of this program is to monitor various key
system metrics such as CPU usage, memory consumption, disk space, GPU usage, and individual
CPU core temperatures. By utilizing libraries such as psutil for system metrics and tkinter for the
graphical user interface (GUI), this application enables users to gain real-time insights into the
operational health of their system.
5.2 Purpose
The purpose of this document is to offer a comprehensive guide to the system's internal design,
architecture, data flow, and the relationship between its components. In addition to the functional
and non-functional requirements, this document covers the layout and structure of the user
interface, the logic layer, and the interaction between the system and its hardware components.
5.3 Scope
This document is intended for developers and system administrators responsible for maintaining the
application, as well as for users who may wish to extend the system's capabilities in the future.
While this design covers the core functionalities related to system monitoring, future versions may
extend the scope to include logging, alert notifications, and remote monitoring capabilities.
5.4 Existing System Challenges
5.5 Limitations of Traditional System Monitoring Tools
Currently, there are several widely-used system monitoring tools available, including resource-
heavy programs such as Task Manager (Windows) and Activity Monitor (macOS). However, these
tools have certain inherent limitations:
1. Limited Customization: Traditional system monitoring programs offer limited scope for
customization. Users cannot add additional metrics or adjust the intervals at which data is
updated.
2. High Resource Consumption: Some system monitoring applications, particularly those with
rich graphical displays, tend to consume significant system resources themselves, thereby
impacting system performance.
3. Platform-Specific Designs: Most system monitoring tools are tied to specific operating
systems, meaning users who switch between platforms must use entirely different software
for each system.
4. No GPU Monitoring: Many basic monitoring tools do not support GPU monitoring,
particularly on lower-end systems or those without dedicated software for graphics card
management.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 12
5.6 Need for a New System
In light of these limitations, the proposed system monitoring application seeks to offer a
lightweight, cross-platform, customizable alternative. The new system is intended to be user-
friendly, resource-efficient, and capable of monitoring a wider range of system metrics, including
GPU usage and CPU temperatures.
5.7 System Architecture
5.8 Overview of the Architecture
The system architecture is built on a three-layer design that ensures separation of concerns,
scalability, and maintainability. The layers are designed to be modular, enabling easier future
enhancements, including network monitoring and alert systems.
5.9 Presentation Layer
The presentation layer comprises the graphical user interface (GUI) built using Python's tkinter
library. This layer allows users to visualize real-time system metrics in an intuitive, accessible
manner. The GUI will feature key metrics such as CPU, memory, disk, and GPU usage in the form
of progress bars, numerical displays, and visual graphs.
Key UI Components:
• Dashboard: A unified interface displaying real-time statistics for CPU, memory, disk, and
GPU usage. The GUI will update dynamically as system data is retrieved.
• Individual Core Metrics: For advanced users, individual core CPU usage will be shown,
helping identify underperforming cores.
• User Controls: Simple controls like "Start Monitoring" and "Stop Monitoring" buttons for
initiating or terminating the system check. There is also the possibility of adding refresh rate
settings for advanced users.
5.10 Logic Layer
The logic layer is responsible for collecting, processing, and interpreting system data. It acts as the
intermediary between the presentation and data layers, converting raw data from system calls into
meaningful statistics that can be displayed visually.
Functions Include:
• Retrieving CPU Usage: Using psutil.cpu_percent(interval=1) to calculate the percentage of
CPU utilized over a specified interval.
• Monitoring Memory Usage: Calling psutil.virtual_memory() to collect data on the total
available memory and the portion currently in use.
• GPU Data Retrieval: Leveraging GPUtil (if a GPU is present) to fetch real-time data on
GPU load and temperature.
• Error Handling and Data Integrity: The system will handle exceptions, ensuring that
unsupported features (like GPU monitoring on machines without a GPU) do not cause
crashes or erroneous outputs.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 13
5.11 Data Layer
The data layer interacts directly with the operating system to fetch low-level system metrics,
translating these into usable information. It relies heavily on system APIs via the psutil library to
retrieve data. For GPUs, the program uses the GPUtil library, which can access information about
both integrated and dedicated GPUs.
Data collected from the system includes:
• CPU and core-specific utilization percentages
• Available memory and swap usage
• Disk I/O and usage statistics
• GPU load and temperature (if supported)
• CPU core temperatures (if sensors are available)
5.12 Data Flow Design
5.13 Data Flow Overview
The system’s data flow is straightforward, focusing on real-time monitoring and instantaneous
feedback to the user without the need for data storage or cloud transmission.
Data Flow Process:
• User Interaction: Upon initiating a system check through the GUI, the system immediately
triggers the logic layer to begin retrieving system metrics.
• Data Retrieval: The logic layer makes requests to the data layer to fetch system metrics. For
example, calling psutil.cpu_percent(interval=1) will return the current CPU utilization.
• Data Processing: The logic layer processes this data, calculating percentages or averages as
required, and formats it for display.
• Data Display: The processed data is then displayed on the GUI. For instance, CPU
utilization data is presented as both a percentage and a graphical bar.
5.14 DATA FLOW DIAGRAM(DFD)
A DFD is a network that describes the flow of data throughout a system, data stores, and the
process that change or transform data flows. Data Flow Diagrams are also known as Data Flow
Graphs. DFDs are commonly used during the problem analysis stage. They are useful in
understanding a system and can be effectively used for partitioning during analysis. The DFD
network is a formal, logical abstract of a system that may have many possible physical
configurations. This reason a set of symbols that do not imply a physical form are used to represent
data source, data flows, data transformations and data storage.
The basic element of DFD is:
Circle or Bubble Process: A process that represents some amount of work being performed on data.
Rectangle External Entity: This represents any outside agency, which interact with the system. It
represents the source or destination of data for the system under consideration.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 14
Arrow Data Flow: The data flow portrays an interface among different components in a DFD. It
represents flow of data between a process and an external entity or between a process and data
store.
One-end opened rectangle Data Stores: A data store is a place for holding information within the
system.
Level-0 DFD (Context Diagram):
User Request Resource System Resource
Monitor
Level-1 DFD:
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 15
5.15 Entity-Relationship Diagram(E-R Diagram)
An Entity-Relationship Diagram (ER Diagram) is a visual representation used in database design to
model the relationships between data entities within a system. It helps in structuring and organizing
the data for a database, making it an essential tool in the conceptual design phase.
Entities: These represent real-world objects or concepts that store data, such as "Employee,"
"Customer," or "Product." In the diagram, entities are depicted as rectangles.
Attributes: These are the properties or characteristics of an entity. For example, an "Employee"
entity might have attributes like "EmployeeID," "Name," and "Salary." Attributes are represented by
ovals connected to their respective entities.
Relationships: These define how entities are connected to one another. For instance, an "Employee"
might "Work For" a "Department." Relationships are depicted as diamonds and are typically
labelled with a verb that describes the interaction.
Cardinality: This specifies the nature of the relationship between entities, indicating whether one
entity can be associated with a single instance or multiple instances of another entity. The most
common types are one-to-one (1:1), one-to-many (1), and many-to-many (M).
Rectangle (Entity):
• Represents: An entity, which is a real-world object or concept that stores data. Each entity
typically becomes a table in a relational database.
• Examples: "Customer," "Employee," "Product."
Oval (Attribute):
• Represents: An attribute, which is a characteristic or property of an entity. Attributes store
details about the entity, such as a name, ID, or other data points.
• Examples: "Name," "EmployeeID," "Price."
Diamond (Relationship):
• Represents: A relationship between entities. This shows how two or more entities are related
or interact with each other.
• Examples: "Works for" (relationship between "Employee" and "Department"), "Buys"
(relationship between "Customer" and "Product").
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 16
Double Oval (Multivalued Attribute):
• Represents: An attribute that can have multiple values for a single entity.
• Example: An entity "Person" could have a multivalued attribute "Phone Numbers," where
more than one phone number is associated with the person.
Dashed Oval (Derived Attribute):
• Represents: An attribute whose value can be derived from other attributes in the database.
• Example: "Age" can be a derived attribute if "Date of Birth" is stored in the database.
Double Rectangle (Weak Entity):
• Represents: A weak entity, which is an entity that cannot be uniquely identified by its own
attributes alone and relies on a "strong" or "owner" entity for identification.
• Example: "Dependent" could be a weak entity in a relationship with "Employee."
Double Diamond (Identifying Relationship):
• Represents: A special kind of relationship that connects a weak entity to its identifying
strong entity.
• Example: The relationship between "Dependent" and "Employee" in an insurance system.
Lines:
• Represents: Connections between entities and relationships or between entities and their
attributes.
• Examples: A line from "Employee" (entity) to "WorksFor" (relationship) or from
"Customer" (entity) to "Name" (attribute).
Crow's Foot Notation (Cardinality):
• Represents: The number of entities that can be involved in a relationship.
• A straight line with a single dash represents one-to-one (1:1) relationships.
• A line branching into a "crow's foot" represents a one-to-many (1
) or many-to-many (M
) relationship.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 17
Entity-Relationship Diagram
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 18
5.16 User Interface Design
5.17 User Experience Goals
The primary focus of the user interface design is simplicity and efficiency. While the system needs
to provide detailed metrics for power users, it must also remain accessible to casual users who may
simply want an overview of their system's health.
5.18 User Interface Components
The user interface is broken down into specific sections to provide clarity and ease of navigation.
• Main Dashboard: The central hub of the application, where key metrics like CPU and
memory usage are displayed. Users can view both overall usage and detailed core-specific
data. The dashboard will be updated in real-time.
• CPU Usage: A bar graph for overall CPU usage and individual progress bars for each CPU
core. This allows users to identify performance bottlenecks or overutilization of certain
cores.
• Memory and Disk Usage: Simple, color-coded progress bars show RAM usage and disk
capacity. A numerical representation (e.g., "5 GB used of 16 GB") will accompany each bar
for easy interpretation.
• GPU Monitoring: For systems with GPUs, a dedicated section will display GPU usage and
temperature, providing insight into how demanding tasks are affecting the GPU.
• Temperature Monitoring: Real-time temperature monitoring for each CPU core will be
visible, helping users ensure their system stays within safe operating limits.
5.19 Future Enhancements for UI
Additional UI features such as a logging window, graphical charts (e.g., line graphs to show trends
over time), or customizable settings for refresh rates and alert notifications can be introduced in
future versions of the system.
5.20 Hardware and Software Requirements
5.21 Hardware Requirements
The system has relatively low hardware requirements, ensuring it can be used across a wide variety
of machines without significant performance degradation.
• Processor: A basic processor (Intel i3 or equivalent) is sufficient to run the monitoring
application. However, for more accurate multi-core monitoring, a quad-core or higher CPU
is recommended.
• Memory: At least 2 GB of RAM is necessary, though the program is lightweight and won't
require more unless future versions include data logging.
• Disk Space: The application itself consumes very little storage (around 50-100 MB),
making it suitable even for systems with limited storage.
• Graphics: A GPU is not strictly required, but the application will use the GPUtil library to
monitor GPU performance if available.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 19
5.22 Software Requirements
The application relies on Python and several libraries that need to be installed on the system.
• Python: Version 3.6 or higher is required. Python is a lightweight and cross-platform
programming language, making this system compatible with Windows, macOS, and Linux.
• Required Libraries:
• psutil: For system-level data retrieval.
• tkinter: For building the graphical user interface.
• GPUtil: Optional, used for monitoring GPU statistics.
• Operating System: The application will run on any system supporting Python, including
Windows 10+, macOS, and most Linux distributions.
5.23 Security Design
5.24 Data Security
The system operates entirely locally, and no sensitive information is transmitted or stored. As such,
there are no significant data security concerns. The application will have access to system metrics,
but this data is only retrieved and processed within the user's machine.
5.25 Error Handling
Robust error handling will be integrated into the application to prevent crashes. For example, if a
machine lacks a GPU, the application will disable the GPU monitoring feature, ensuring that
unsupported hardware does not cause failures.
5.26 Future Security Enhancements
In future versions, additional security measures could be introduced, such as encrypting any locally
stored logs (if logging is added) and incorporating alerts for overheating or overuse thresholds.
5.27 System Deployment and Installation
5.28 Installation Process
The system can be installed either as a standalone Python program or packaged into an executable
using PyInstaller. A simple step-by-step installer will be provided for ease of installation, especially
for non-technical users.
5.29 Deployment Considerations
Deployment of the program is straightforward as it does not require cloud infrastructure or complex
configurations. For users who prefer not to install Python and the necessary libraries, precompiled
executables for Windows and macOS can be provided.
5.30 Cross-Platform Deployment
The cross-platform nature of Python ensures that this application can be deployed across various
operating systems. The same codebase will run on Windows, Linux, and macOS without requiring
platform-specific changes.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 20
6.Coding and Implementation
6.1. Introduction to Coding and Implementation
In the coding and implementation phase of the System Resourse Monitor, the design specifications
and system architecture are transformed into executable code. The system will monitor essential
performance metrics such as CPU usage, memory usage, disk usage, GPU usage (if applicable), and
CPU core temperatures. The primary tools and libraries used for implementation are Python, psutil,
tkinter, and GPUtil (optional). The application provides real-time data about system performance,
and this section will explore the development process in detail.
6.2 Tools and Libraries Used
The project relies on several critical Python libraries to collect and display system data. These
libraries facilitate system resource monitoring and graphical user interface (GUI) development:
• psutil: This Python module provides an interface for retrieving information on system
utilization (CPU, memory, disks, network, sensors) and running processes. It is platform-
independent and works across Linux, Windows, and macOS.
• tkinter: The standard Python library for building GUIs. It provides the necessary tools to
create an interactive application that displays the system metrics in a user-friendly manner.
• GPUtil: This optional library provides functionality to monitor GPU utilization and
temperature, helpful if the system has GPU capabilities. The application will use this to
check if GPU monitoring is applicable.
6.3 Program Structure and Design
The application follows a modular design pattern to make the code maintainable and scalable. Each
module has specific responsibilities that contribute to the program's overall functionality.
3.1. Key Components:
1. System Metrics Module: This module handles the collection of real-time data on CPU usage,
memory usage, disk usage, and GPU metrics (if applicable). Using the psutil library, it
gathers this information periodically and returns the required values.
2. GUI Module: The GUI component is responsible for displaying the metrics in a clear and
concise manner using the tkinter library. The interface includes labels or progress bars that
are dynamically updated to reflect current system conditions.
3. Error Handling Module: This part of the application manages exceptions, such as missing
GPU hardware or system-specific limitations. It ensures that the program does not crash and
provides meaningful feedback to the user.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 21
6.4 Code Implementation
The system is implemented by following several steps:
1.1. CPU and Memory Monitoring Using psutil
import psutil
# Function to get system metrics
def get_system_metrics():
cpu_usage = psutil.cpu_percent(interval=1)
memory_info = psutil.virtual_memory()
disk_usage = psutil.disk_usage('/')
return cpu_usage, memory_info.percent, disk_usage.percent
This code collects CPU usage, memory information, and disk usage in real-time. The
psutil.cpu_percent() function tracks CPU utilization, psutil.virtual_memory() returns a summary of
memory usage, and psutil.disk_usage() checks how much disk space is used.
1.2 GPU Monitoring Using GPUtil
If the system includes a GPU, the GPUtil library monitors the GPU load and temperature.
import GPUtil
# Function to get GPU metrics
def get_gpu_metrics():
gpus = GPUtil.getGPUs()
for gpu in gpus:
gpu_load = gpu.load * 100
gpu_temp = gpu.temperature
return gpu_load, gpu_temp
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 22
The get_gpu_metrics() function retrieves the GPU load and temperature, providing valuable
insights for systems with dedicated GPUs.
1.3 Creating the GUI Using Tkinter
The GUI is designed using tkinter, and it displays the real-time metrics. This section handles the
layout, real-time updates, and interaction.
1.4 GUI Layout
The GUI is simple yet functional, with labels to display the CPU, memory, and disk usage:
import tkinter as tk
# Update GUI with system metrics
def update_gui():
cpu_usage, mem_usage, disk_usage = get_system_metrics()
cpu_label.config(text=f'CPU Usage: {cpu_usage}%')
mem_label.config(text=f'Memory Usage: {mem_usage}%')
disk_label.config(text=f'Disk Usage: {disk_usage}%')
root.after(1000, update_gui) # Update every 1 second
# Initialize Tkinter window
root = tk.Tk()
root.title("System Monitoring Tool")
# Create labels for displaying metrics
cpu_label = tk.Label(root, text="CPU Usage: ", font=('Helvetica', 12))
cpu_label.pack()
mem_label = tk.Label(root, text="Memory Usage: ", font=('Helvetica', 12))
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 23
mem_label.pack()
disk_label = tk.Label(root, text="Disk Usage: ", font=('Helvetica', 12))
disk_label.pack()
# Start the GUI loop
update_gui()
root.mainloop()
This section ensures that the application updates the system metrics in the GUI every second. The
root.after(1000, update_gui) function makes sure that the data is refreshed continuously.
6.5 Real-Time Data Updates
The core functionality of the application relies on continuously fetching and updating system
metrics in the GUI. Real-time data monitoring is achieved by setting an interval to retrieve data at
regular intervals (e.g., every second).
The function root.after(1000, update_gui) ensures that the get_system_metrics() function is called
repeatedly to keep the displayed data current. This creates the effect of a live dashboard, providing
the user with up-to-date system performance information.
6.6 Error Handling
To ensure that the application functions smoothly under various conditions, error handling
mechanisms are incorporated. For example:
• Missing GPU: If the system lacks GPU hardware, the get_gpu_metrics() function catches
the error and displays a message instead of crashing.
• Platform-Specific Issues: Since psutil and tkinter are cross-platform libraries, the
application runs on Windows, Linux, and macOS. However, platform-specific testing
ensures that any discrepancies are handled appropriately.
Example of handling GPU errors:
try:
gpu_usage, gpu_temp = get_gpu_metrics()
gpu_label.config(text=f'GPU Usage: {gpu_usage}% | GPU Temp: {gpu_temp}°C')
except:
gpu_label.config(text="No GPU Detected")
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 24
6.7 Optimization Techniques
To ensure the application does not use excessive resources itself, several optimizations are
implemented:
• Update Frequency: Reducing the frequency of updates to every 2-3 seconds can lower the
load on the CPU, preventing the monitoring tool from overloading the system.
• Multi-threading: If necessary, the application can use multi-threading to prevent the GUI
from freezing during data collection.
• Modularity: The modular design ensures that each function only handles a specific task,
making it easy to maintain and scale the system in the future.
6.8 Testing and Validation
1.1. Functionality Testing
The application is tested for accuracy in reporting system metrics. Various test cases include
running multiple processes to check the CPU load, using heavy memory-consuming applications,
and verifying GPU performance under different conditions.
1.2. Cross-Platform Testing
The application is tested on multiple operating systems (Windows, macOS, and Linux). Since psutil
is cross-platform, minimal adjustments are necessary to ensure compatibility.
1.3. Performance Testing
Stress tests are performed to ensure the application remains responsive and does not become a
bottleneck while monitoring system performance.
6.8 Conclusion
The coding and implementation phase has resulted in a fully functional system monitoring tool that
provides real-time feedback on CPU, memory, disk, and GPU usage. Using Python's psutil, tkinter,
and GPUtil, the system offers users a simple yet effective way to monitor their machine's
performance. The code is modular, scalable, and optimized for efficient resource usage, making it
suitable for a wide range of systems.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 25
7.System Testing
System testing is a critical phase in the software development lifecycle that ensures the application
is fully functional and meets its specified requirements. For the System Monitoring Application,
various levels of testing are conducted to validate that the system operates efficiently, displays
accurate data, and provides a good user experience. The following sections cover the different
testing stages involved in this project.
1. Levels of Testing
Testing the application involves multiple stages, each focusing on different components or
behaviors of the system. These levels of testing include:
1.1. Unit Testing
Unit testing involves testing individual components of the code to ensure that they work as expected
in isolation. The smallest units of the code, such as functions or methods, are validated.
• CPU, Memory, Disk, and GPU Monitoring Functions: Each function that gathers data (e.g.,
CPU usage, memory usage, disk usage, GPU usage) is tested independently.
• Tkinter GUI Components: Ensure that the GUI elements like labels and buttons function
correctly.
Example:
def test_get_system_metrics():
cpu_usage, mem_usage, disk_usage = get_system_metrics()
assert isinstance(cpu_usage, float)
assert isinstance(mem_usage, float)
assert isinstance(disk_usage, float)
assert 0 <= cpu_usage <= 100
assert 0 <= mem_usage <= 100
assert 0 <= disk_usage <= 100
test_get_system_metrics()
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 26
This tests whether the system metric functions return appropriate values and within the valid range.
1.2. Integration Testing
Integration testing focuses on testing the interaction between different modules of the application.
After unit testing ensures the individual functions work correctly, integration testing ensures they
work together seamlessly.
• Integrating psutil and tkinter: Ensure that system metrics are collected and displayed in the
GUI without causing performance issues or incorrect data representation.
• Real-time Updates: Verify that the application updates system metrics at the intended
intervals (e.g., every second), and the GUI remains responsive.
For example, testing that the system metrics collected by psutil are properly displayed in the GUI
without any delays or crashes.
1.3. System Testing
System testing involves testing the entire application in a fully integrated environment. The goal is
to ensure that the program behaves correctly as a whole and meets the project requirements.
• Performance Under Load: The application is tested under conditions where the CPU and
memory are heavily utilized (e.g., running multiple applications simultaneously) to ensure it
reports accurate data without crashing.
• Cross-Platform Compatibility: The program is tested on multiple operating systems
(Windows, Linux, and macOS) to verify that it works consistently across different platforms.
• Hardware-Specific Testing: In systems with and without GPUs, the application should
correctly monitor or skip GPU metrics depending on availability.
2. Specific Testing Types
In addition to the levels of testing described above, specific types of testing are conducted to cover
critical aspects of the software.
2.1. Validation Testing
Validation testing ensures that the system meets the functional and non-functional requirements
outlined during the design phase. It checks if the software performs according to user expectations.
• Functionality Validation: Ensure the application provides accurate data on CPU usage,
memory usage, disk usage, and GPU usage (where applicable).
• User Interface Validation: Ensure the GUI is user-friendly, and the layout is intuitive and
accessible.
• Responsiveness Validation
• : The application must update system metrics in real time without delays.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 27
2.2. Output Testing
Output testing involves ensuring that the outputs of the system are correct and meet the expected
results. For the System Resource Monitor, output testing focuses on verifying the accuracy of
system metrics being displayed.
• CPU Usage Output: Check that the CPU usage percentage matches other monitoring tools or
system utilities.
• Memory and Disk Usage: Compare the memory and disk usage outputs with other system
monitoring tools to ensure consistency.
• Error Outputs: If a system component (e.g., GPU) is not present, the application should
correctly display "No GPU Detected" instead of crashing.
2.3. User Acceptance Testing (UAT)
User acceptance testing is the final testing phase, where real users or stakeholders test the
application to ensure it meets their needs and expectations. This testing ensures that the system
delivers value and solves the user's problem.
• Ease of Use: End users test the system to determine if the interface is intuitive and easy to
navigate.
• Real-Time Feedback: Users validate that the system provides accurate, up-to-date system
metrics without lag or glitches.
• Error Handling: Users test how the system responds to edge cases, such as sudden spikes in
CPU usage or when certain hardware is not present.
3. Detailed Testing Process
3.1. Unit Testing in Detail
Each function and component of the code is tested in isolation to ensure that it behaves as expected.
• Testing CPU, Memory, and Disk Functions: The core functions that retrieve system data are
tested by feeding them different scenarios (e.g., high CPU usage, low memory availability)
and validating that the correct results are returned.
Example:
def test_high_cpu_usage():
cpu_usage, mem_usage, disk_usage = get_system_metrics()
assert cpu_usage >= 90, "Expected CPU usage to be high"
def test_low_memory():
_, mem_usage, _ = get_system_metrics()
assert mem_usage >= 90, "Expected memory usage to be high"
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 28
Tkinter Unit Testing: Testing GUI elements is more complex, but tools like unittest.mock can
simulate GUI interactions, ensuring buttons and labels behave correctly.
3.2. Integration Testing in Detail
The integration of system monitoring functions with the graphical interface is tested extensively.
The following key integrations are checked:
• Real-time Data Updates: Ensures that system metrics (CPU, memory, etc.) are fetched every
second and displayed accurately.
• Multi-threading (if applicable): Ensures that the monitoring and GUI operations run in
separate threads to prevent the GUI from freezing while data is being fetched.
def test_integration_real_time_updates():
# Check that CPU usage label is updated every second
cpu_usage_label_before = cpu_label.cget("text")
time.sleep(2) # Wait for 2 seconds
cpu_usage_label_after = cpu_label.cget("text")
assert cpu_usage_label_before != cpu_usage_label_after, "Expected CPU usage label to be
updated"
3.3. System Testing in Detail
System testing involves running the application under various real-world conditions:
• Testing Under Load: The program is run while the system is under heavy load (e.g., running
resource-intensive applications) to ensure it can still report accurate metrics.
• Cross-Platform Testing: The application is tested on Windows, macOS, and Linux to ensure
the functionality is consistent and no platform-specific bugs exist.
• Missing Hardware Components: If a GPU is absent, the system must correctly handle this
scenario without crashing.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 29
8.System Maintenance
System maintenance involves ongoing efforts to ensure that the software continues to perform
effectively and efficiently after it has been deployed. It encompasses a variety of tasks aimed at
correcting issues, improving performance, and ensuring the application meets changing user needs.
For the System Resource Monitor, the following areas of maintenance will be essential
1. Types of Maintenance
1.1. Corrective Maintenance
Corrective maintenance addresses issues that arise after deployment. It involves fixing bugs and
defects that users report, ensuring the application continues to function correctly.
• Bug Tracking: Implement a bug tracking system to log issues as they arise. This allows for
prioritized bug fixing based on severity and impact.
• Patching: Regularly update the application to fix identified bugs or vulnerabilities, ensuring
that users are informed of any patches applied.
1.2. Adaptive Maintenance
Adaptive maintenance is focused on updating the application to remain compatible with changes in
the environment, such as operating system updates or changes in underlying libraries.
• Compatibility Updates: As new versions of psutil, tkinter, or the operating systems are
released, the application may need updates to maintain compatibility.
• Performance Optimization: Periodically review the application’s performance metrics and
update algorithms or code to enhance performance based on user feedback.
1.3. Perfective Maintenance
Perfective maintenance involves making enhancements to the system based on user feedback or
changing requirements.
• Feature Enhancements: Based on user suggestions, consider adding new features like
advanced reporting or additional metrics (e.g., network usage).
• User Interface Improvements: Regularly solicit feedback from users to identify areas where
the user interface can be improved for better usability and experience.
1.4. Preventive Maintenance
Preventive maintenance aims to reduce the likelihood of future issues by conducting regular checks
and updates.
• Scheduled Reviews: Implement a schedule for reviewing code, dependencies, and system
metrics to identify potential problems before they impact users.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 30
• Documentation Updates: Regularly update technical documentation and user manuals to
reflect changes in the application, ensuring that all stakeholders are informed of new
features or changes.
2. Maintenance Procedures
2.1. Monitoring System Performance
• Automated Monitoring Tools: Utilize monitoring tools to continuously assess application
performance and user experience, allowing for proactive issue identification.
• User Feedback Mechanisms: Implement feedback forms or in-app prompts to gather user
insights on application performance and potential areas for improvement.
2.2. Issue Reporting and Resolution
• User Reporting System: Develop a user-friendly issue reporting feature that allows users to
report problems directly from the application.
• Resolution Tracking: Maintain a log of issues reported, their status (open, in progress,
resolved), and the timelines for resolution.
3. Documentation
• Maintain Comprehensive Documentation: Keep detailed documentation for code,
dependencies, and user instructions updated to facilitate easier maintenance and onboarding
of new developers.
• Change Log: Maintain a change log to track modifications, enhancements, and bug fixes for
transparency and future reference.
4. Training and Support
• User Training: Provide ongoing training sessions for users to help them understand new
features and improvements.
• Technical Support: Establish a support system (e.g., helpdesk or forum) where users can
seek assistance for issues they encounter.
5. Regular Updates
• Version Control: Implement a version control system (like Git) to manage changes and
facilitate collaboration among developers.
• Scheduled Releases: Plan regular release cycles (e.g., monthly, quarterly) to implement
updates, enhancements, and bug fixes in a structured manner.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 31
6. Backup and Recovery
• Data Backup Procedures: Establish a routine for backing up application data and
configurations to prevent data loss in case of failures.
• Disaster Recovery Plans: Develop and test a disaster recovery plan to ensure rapid
restoration of the application in case of catastrophic failure.
9.System Security
In the modern technological environment, ensuring system security is a top priority. The System
Resource Monitor deals with sensitive system metrics, and it must be designed and maintained
with a focus on safeguarding data and preventing unauthorized access. This section will discuss the
key security considerations and strategies implemented in the application to maintain a high level of
security.
1. Types of Security Threats
Security threats can arise from various sources, and the system must be designed to mitigate them
effectively. Common threats include:
1.1. Unauthorized Access
One of the primary threats to any system is unauthorized access, where an attacker gains entry to
restricted areas of the system, potentially accessing or altering sensitive data.
• Potential Risks: Unauthorized access to system monitoring data could reveal critical system
information such as CPU usage, memory statistics, and GPU status that could be exploited
by attackers.
1.2. Data Breaches
A data breach occurs when confidential or sensitive data is accessed, copied, or transmitted without
authorization.
• Potential Risks: In the context of this application, data breaches could involve exposing
sensitive performance data or logs that could provide insights into system weaknesses.
1.3. Malware and Viruses
Malware and viruses are common attack vectors that could affect system functionality and
compromise data integrity.
• Potential Risks: Malicious software could tamper with system monitoring functions,
providing false metrics or causing the application to crash, leaving the system unmonitored.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 32
1.4. Denial of Service (DoS) Attacks
DoS attacks aim to make the application unavailable by overwhelming it with an excessive number
of requests.
• Potential Risks: A DoS attack on the System Resource Monitor could prevent users from
accessing critical system metrics when needed, especially in a resource-constrained
environment.
2. Security Measures Implemented
To protect against these and other potential security risks, the System Monitoring Application
incorporates various security measures, including authentication, encryption, regular updates, and
robust error handling.
2.1. User Authentication
User authentication ensures that only authorized users can access the application.
• Login System: Implementing a secure login system with password protection helps ensure
that unauthorized individuals cannot access the system's core functions.
• Two-Factor Authentication (Optional): For enhanced security, two-factor authentication
(2FA) could be integrated, requiring users to verify their identity through an additional
method, such as a text message or email code.
2.2. Encryption
Encryption is a critical measure to protect sensitive data both in transit and at rest.
• Data Encryption: System metrics and logs can be encrypted using modern cryptographic
algorithms (e.g., AES) before being stored or transmitted.
• Transport Layer Security (TLS): When transmitting system metrics over a network (e.g., to
remote servers or dashboards), ensuring that data is transmitted over secure channels using
TLS protocols is essential.
2.3. Role-Based Access Control (RBAC)
RBAC ensures that users only have access to the information and functions they need based on their
role.
• Admin and User Roles: In this application, different user roles can be defined. Admins have
full control over system monitoring, configuration, and logs, while standard users may have
limited access to basic metrics.
• Granular Permissions: Define what specific users or roles can do within the system,
preventing unauthorized individuals from accessing sensitive or critical system functions.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 33
2.4. Error Handling and Logging
Error handling and logging are essential security features that help detect and prevent potential
security issues before they escalate.
• Secure Error Messages: Ensure that error messages do not reveal sensitive information (e.g.,
stack traces, system details) that could be used to exploit the application.
• Logging Security Events: Log critical system events such as login attempts (successful and
failed), changes to system configurations, and any potential security-related incidents.
• Intrusion Detection: The application can include mechanisms to detect unusual activities
(e.g., multiple failed login attempts) and trigger alerts or actions such as temporary user
account suspension.
2.5. Regular Security Audits and Updates
Regular updates and security audits are key to keeping the application secure against emerging
threats.
• Patch Management: Continuously update the application to address security vulnerabilities
as new threats are discovered. This includes updating dependencies like psutil and tkinter to
their latest, secure versions.
• Vulnerability Scanning: Periodically scan the application for vulnerabilities using tools like
OWASP ZAP or static analysis tools to ensure no security gaps are present.
3. Data Security
3.1. Data Integrity
Ensuring that the data the application collects and displays remains accurate and unaltered is
essential for system monitoring.
• Integrity Checks: Implement checks to ensure that data being displayed (e.g., CPU usage,
memory usage) is genuine and has not been tampered with.
• Audit Trails: Maintain an audit trail of system activities to track any unusual or suspicious
modifications to system metrics or configuration files.
3.2. Backup and Recovery
Maintaining secure backups and a well-defined recovery process is vital in case of data loss or
corruption.
• Data Backup: Ensure that data and system logs are regularly backed up in a secure location,
with appropriate encryption.
• Disaster Recovery: Have a disaster recovery plan in place that includes restoring system data
and configurations from a secure backup.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 34
4. Securing Communication Channels
If the application needs to send data across a network (e.g., sending monitoring data to a server),
secure communication channels must be implemented.
4.1. Secure API Access
If an API is used to transmit system metrics, secure it using strong authentication methods such as
API keys, OAuth, or token-based authentication.
4.2. Network Security
• Firewall Protection: Configure firewalls to prevent unauthorized access to the system
monitoring application, especially if it is deployed in a networked environment.
• VPN (Virtual Private Network): If sensitive system data is transmitted across the internet,
use a VPN to encrypt the data and ensure secure communication.
5. Penetration Testing
Regular penetration testing (pen testing) is essential to assess the application’s resilience to real-
world attacks.
5.1. Internal and External Testing
• Internal Pen Testing: Conduct internal penetration tests to simulate attacks from within the
organization, testing how well the system handles potential insider threats.
• External Pen Testing: Hire third-party security experts to perform external penetration tests,
simulating real-world cyberattacks to identify and address vulnerabilities.
5.2. Threat Modelling
Conduct threat modeling exercises to anticipate potential attack vectors and strengthen the system's
defenses accordingly.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 35
10.SOURCE CODE
import tkinter as tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import psutil
import time
import threading
from queue import Queue, Empty
import shutil
import random
# Try to import GPUtil; if unavailable, fallback to simulation
try:
import GPUtil
gpu_available = True
except ImportError:
gpu_available = False
print("GPUtil not available, simulating GPU usage.")
# Helper function to create Toplevel windows
def create_toplevel_window(title, geometry, font=("Helvetica", 16)):
window = tk.Toplevel()
window.title(title)
window.geometry(geometry)
return window
# Main application class for resource monitoring
class SystemResourceMonitor:
def __init__(self, root):
self.root = root
self.root.title("System Resource Monitor")
# Initialize plot and canvas
self.fig, self.ax = plt.subplots()
self.canvas = FigureCanvasTkAgg(self.fig, master=root)
self.canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1)
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 36
self.canvas.draw()
# Variables to store resource data
self.cpu_usages, self.mem_usages, self.disk_usages, self.gpu_usages = [],
[], [], []
self.queue = Queue()
# Start the update thread (daemon)
self.update_thread = threading.Thread(target=self.update_usage,
daemon=True)
self.update_thread.start()
# Display resource usage periodically
self.display_usage()
# Add buttons
self.add_buttons()
def add_buttons(self):
tk.Button(self.root, text="Process", command=self.open_interface).pack()
tk.Button(self.root, text="CPU Temperatures",
command=self.show_temperatures).pack()
tk.Button(self.root, text="Disk Usage",
command=self.show_disk_usage).pack()
def display_usage(self):
try:
cpu_usage, mem_usage, disk_usage, gpu_usage = self.queue.get_nowait()
self.cpu_usages.append(cpu_usage)
self.mem_usages.append(mem_usage)
self.disk_usages.append(disk_usage)
self.gpu_usages.append(gpu_usage)
# Only keep the last 20 entries
self.cpu_usages, self.mem_usages, self.disk_usages, self.gpu_usages = (
self.cpu_usages[-20:], self.mem_usages[-20:], self.disk_usages[-20:],
self.gpu_usages[-20:]
)
# Update the plot
self.ax.clear()
self.ax.plot(self.cpu_usages, label='CPU Usage')
self.ax.plot(self.mem_usages, label='Memory Usage')
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 37
self.ax.plot(self.disk_usages, label='Disk Usage')
self.ax.plot(self.gpu_usages, label='GPU Usage')
self.ax.legend()
self.ax.set_ylim(0, 100)
self.canvas.draw()
except Empty:
pass
self.root.after(500, self.display_usage)
def update_usage(self):
while True:
cpu_usage = psutil.cpu_percent(interval=None)
mem_usage = psutil.virtual_memory().percent
disk_usage = psutil.disk_usage('/').percent
gpu_usage = self.get_gpu_usage() # Get GPU usage
self.queue.put((cpu_usage, mem_usage, disk_usage, gpu_usage))
time.sleep(0.5)
def get_gpu_usage(self):
if gpu_available:
# Use GPUtil to get real GPU usage
gpus = GPUtil.getGPUs()
if gpus:
return gpus[0].load * 100 # GPU usage as a percentage
return 0 # Return 0 if no GPU is available
else:
# Simulate GPU usage
return random.uniform(10, 80)
def open_interface(self):
interface_window = create_toplevel_window("Running Processes", "500x500")
def get_running_processes(search_term=""):
return [
(p.info['pid'], p.info['name'])
for p in psutil.process_iter(attrs=['pid', 'name'])
if search_term.lower() in p.info['name'].lower()
]
def update_process_list():
search_text = search_entry.get()
process_list.delete(0, tk.END)
for pid, name in get_running_processes(search_text):
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 38
process_list.insert(tk.END, f"{pid}: {name}")
search_entry = tk.Entry(interface_window, font=("Helvetica", 16))
search_entry.pack()
process_list = tk.Listbox(interface_window, height=15, width=85,
font=("Helvetica", 16))
process_list.pack()
tk.Button(interface_window, text="Refresh",
command=update_process_list).pack()
tk.Button(interface_window, text="Search",
command=update_process_list).pack()
update_process_list()
def show_temperatures(self):
temp_window = create_toplevel_window("CPU Temperatures", "300x200")
temp_list = tk.Listbox(temp_window, height=10, width=40,
font=("Helvetica", 16))
temp_list.pack()
# Use psutil to get real CPU temperatures, if available
temperatures = get_cpu_temperatures()
if temperatures:
for core_id, temperature in temperatures:
temp_list.insert(tk.END, f"CPU Core {core_id} Temperature:
{temperature:.2f} °C")
else:
temp_list.insert(tk.END, "Temperature data not available.")
def show_disk_usage(self):
disk_window = create_toplevel_window("Disk Usage", "400x200")
disk_list = tk.Listbox(disk_window, height=10, width=60,
font=("Helvetica", 16))
disk_list.pack()
try:
total, used, free = shutil.disk_usage('/')
used_percent = (used / total) * 100
free_percent = (free / total) * 100
disk_list.insert(tk.END, f"Total: {total / (1024 ** 3):.2f} GB")
disk_list.insert(tk.END, f"Used: {used / (1024 ** 3):.2f} GB
({used_percent:.2f}%)")
disk_list.insert(tk.END, f"Free: {free / (1024 ** 3):.2f} GB
({free_percent:.2f}%)")
except Exception as e:
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 39
disk_list.insert(tk.END, f"Error: {str(e)}")
# Function to get CPU temperatures
def get_cpu_temperatures():
try:
temps = psutil.sensors_temperatures()
if "coretemp" in temps:
core_temps = temps["coretemp"]
return [(i, temp.current) for i, temp in enumerate(core_temps)]
else:
return simulate_cpu_temperatures() # Simulate temperatures if not
available
except Exception:
return simulate_cpu_temperatures() # Fallback to simulation
# Simulate CPU temperature collection in case real sensors are not available
def simulate_cpu_temperatures():
num_cores = psutil.cpu_count()
return [(i, random.uniform(40.0, 70.0)) for i in range(num_cores)]
# Main entry point
if __name__ =* "__main__":
root = tk.Tk()
app = SystemResourceMonitor(root)
root.mainloop()
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 40
11.Screenshot:
Displays the CPU Usage,Memory Usage,Disk Usage,GPU usage.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 41
Processes running in the system background are shown.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 42
Processes can be searched manually to find easily.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 43
The CPU temperatures button will show the temperature in each specific core of the CPU.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
SYSTEM RESOURCE MONITOR 44
The Disk usage button will show the total disk space,used disk space and free disk space.
UNIVERSITY INSITUTE OF TECHNOLOGY,AZHOOR
45
SYSTEM RESOURCE MONITOR
12.Bibliography
Books
1. Mall, Rajib. Fundamentals of Software Engineering. 4th Edition, PHI Learning Pvt. Ltd.,
2014.
• This book provides a comprehensive guide to software engineering principles and
practices. It covers various topics related to system design, coding, testing, and
maintenance, making it a valuable resource for understanding the software
development lifecycle. It also touches on topics such as software project
management, validation, and verification, which are critical for the development and
maintenance of software systems like the System Monitoring Application.
Web Sources
2. "System Monitoring with Python." Real Python, https://realpython.com/python-system-
monitoring/. Accessed September 20, 2024.
• This article from Real Python explains how to use Python libraries like psutil for
system monitoring. It covers various aspects of gathering system metrics such as
CPU usage, memory usage, disk statistics, and more. This source was instrumental in
providing foundational knowledge on implementing real-time system monitoring
using Python.
3. "Python System Resource Monitoring using psutil." PythonProgramming.net,
https://pythonprogramming.net/monitoring-system-statistics-psutil/. Accessed September 22,
2024.
• This resource offers an in-depth tutorial on using the psutil library for system
resource monitoring. The guide focuses on collecting data related to system
performance and visualizing it using Python. It was useful for understanding the
technical implementation of system metrics gathering in the System Monitoring
Application.
4. "An Introduction to System Monitoring with Python." GeeksforGeeks,
https://www.geeksforgeeks.org/system-monitoring-with-python/. Accessed September 18,
2024.
• This article provides a beginner-friendly introduction to system monitoring using
Python. It walks through the process of setting up psutil to monitor CPU, memory,
and disk usage. The article also offers useful insights into troubleshooting common
issues during implementation, making it a valuable reference for the project.
UNIVERSITY INSTITUTE OF TECHNOLOGY,AZHOOR