Documentation¶
Prerequisites¶
This project is intended for Linux systems (it has been tested for Debian).
Here are the dependancies:
sysstat
, a bundle of sytem performance tools,apache2
or another web server that can run scripts,- Python 3.x
Naming
From now on, it will be refered to as Directory.
Before going further, please create a directory for the web interface like /var/www/html/monitoring
.
its path will be needend through this process.
System data collection¶
Data collection is done by script.sh
.
Make it executeable and give it to a user who can write to the Directory and memorize the scripts path.
Open the file and customize the Directory to your liking.
script.sh | |
---|---|
4 |
|
Next, open your crontab (etc/crontab
) and add the script to be executed every minute.
Crontab example | |
---|---|
22 |
|
Check
After a minute, the measures file should appear in the Directory.
Python script¶
Copy index.py
and style.css
into the Directory and make index.py
executeable.
Customization¶
Three variables have been moved to the top of the file to be easily customizable:
Database path | |
---|---|
6 7 8 9 |
|
Target of the 'home' button | |
---|---|
10 11 |
|
Displayed version | |
---|---|
12 13 |
|
Apache configuration¶
You need to make several changes to Apaches configuration:
- Allow script execution
- Add a Python handler
- Load the CGI module
- Make
index.py
the index page
Open Apaches configuration file and create a <Directory>
part for the Directory:
/etc/apache2/apache2.conf | |
---|---|
170 171 172 173 174 175 176 177 |
|
Reload the server:
systemstl reload apache2
Check
The web interface should be availible at http://localhost/Directory.