Add glances

This commit is contained in:
Taylor Helsper 2019-11-11 20:35:05 -06:00
parent b4191ea38e
commit 779129c9de
6 changed files with 60 additions and 3 deletions

View File

@ -0,0 +1,18 @@
# myNode glances service (system monitoring)
# /etc/systemd/system/glances.service
[Unit]
Description=Glances
After=network.target
[Service]
ExecStart=/usr/bin/glances -w
User=root
Group=root
TimeoutSec=300
Restart=always
RestartSec=60
Nice=5
[Install]
WantedBy=multi-user.target

View File

@ -28,6 +28,7 @@ ufw allow 56881 comment 'allow myNode QuickSync'
ufw allow 51413 comment 'allow myNode QuickSync' ufw allow 51413 comment 'allow myNode QuickSync'
ufw allow 6771 comment 'allow myNode QuickSync (LPD)' ufw allow 6771 comment 'allow myNode QuickSync (LPD)'
ufw allow 51194 comment 'allow VPN' ufw allow 51194 comment 'allow VPN'
ufw allow 61208 comment 'allow glances'
ufw allow from 127.0.0.1 comment 'allow from localhost' ufw allow from 127.0.0.1 comment 'allow from localhost'
ufw allow from ::1 comment 'allow from localhost' ufw allow from ::1 comment 'allow from localhost'

View File

@ -12,7 +12,7 @@ systemctl stop bitcoind
# Install any new software # Install any new software
apt -y install pv sysstat network-manager unzip pkg-config libfreetype6-dev libpng-dev apt -y install pv sysstat network-manager unzip pkg-config libfreetype6-dev libpng-dev
apt -y install libatlas-base-dev libffi-dev libssl-dev glances apt -y install libatlas-base-dev libffi-dev libssl-dev glances bottle
# Install any pip software # Install any pip software
pip install tzupdate pip install tzupdate
@ -206,6 +206,7 @@ systemctl enable firewall
systemctl enable invalid_block_check systemctl enable invalid_block_check
systemctl enable usb_driver_check systemctl enable usb_driver_check
systemctl enable https systemctl enable https
systemctl enable glances
# Disable any old services # Disable any old services
sudo systemctl disable hitch sudo systemctl disable hitch

View File

@ -6,6 +6,7 @@ from threading import Timer
from thread_functions import * from thread_functions import *
from user_management import check_logged_in from user_management import check_logged_in
from lightning_info import * from lightning_info import *
from thread_functions import *
import pam import pam
import json import json
import time import time
@ -138,6 +139,10 @@ def page_settings():
"uptime": uptime, "uptime": uptime,
"public_ip": public_ip, "public_ip": public_ip,
"local_ip": local_ip, "local_ip": local_ip,
"drive_usage": get_drive_usage(),
"cpu_usage": get_cpu_usage(),
"ram_usage": get_ram_usage(),
"device_temp": get_device_temp(),
"ui_settings": read_ui_settings() "ui_settings": read_ui_settings()
} }
return render_template('settings.html', **templateData) return render_template('settings.html', **templateData)

View File

@ -227,6 +227,11 @@
); );
}); });
$("#glances").on("click", function() {
url = 'http://'+location.hostname+':61208'
window.open(url,'_blank');
})
$( function() { $( function() {
var downloadHandle = $( "#download-handle" ); var downloadHandle = $( "#download-handle" );
var uploadHandle = $( "#upload-handle" ); var uploadHandle = $( "#upload-handle" );
@ -342,6 +347,32 @@
<td>Local IP</td> <td>Local IP</td>
<td style="padding-left: 20px;">{{local_ip}}</td> <td style="padding-left: 20px;">{{local_ip}}</td>
</tr> </tr>
</table>
<div class="divider"></div>
<div class="settings_block_subheader">Status</div>
<table border="0">
<tr>
<td>Details</td>
<td style="padding-left: 20px;"><a id="glances" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Open Glances</a></td>
</tr>
<tr>
<td>Disk Usage</td>
<td style="padding-left: 20px;">{{drive_usage}}</td>
</tr>
<tr>
<td>CPU</td>
<td style="padding-left: 20px;">{{cpu_usage}}</td>
</tr>
<tr>
<td>RAM</td>
<td style="padding-left: 20px;">{{ram_usage}}</td>
</tr>
<tr>
<td>Temperature</td>
<td style="padding-left: 20px;">{{device_temp}} &deg;C</td>
</tr>
<tr> <tr>
<td>Uptime</td> <td>Uptime</td>
<td style="padding-left: 20px;">{{uptime}}</td> <td style="padding-left: 20px;">{{uptime}}</td>
@ -377,7 +408,7 @@
</form> </form>
<div class="settings_block"> <div class="settings_block">
<div class="settings_block_header">Status</div> <div class="settings_block_header">Service Status</div>
<div class="settings_block_subheader">QuickSync Status</div> <div class="settings_block_subheader">QuickSync Status</div>
<button id="show_quicksync_status" class="ui-button ui-widget ui-corner-all settings_button">Show</button> <button id="show_quicksync_status" class="ui-button ui-widget ui-corner-all settings_button">Show</button>

View File

@ -73,7 +73,7 @@ apt-get -y install inotify-tools libssl-dev tor tmux screen
apt-get -y install python-grpcio python3-grpcio apt-get -y install python-grpcio python3-grpcio
apt-get -y install pv sysstat network-manager rsync parted unzip pkg-config apt-get -y install pv sysstat network-manager rsync parted unzip pkg-config
apt-get -y install libfreetype6-dev libpng-dev libatlas-base-dev apt-get -y install libfreetype6-dev libpng-dev libatlas-base-dev
apt-get -y install libffi-dev libssl-dev glances apt-get -y install libffi-dev libssl-dev glances bottle
# Install other things without recommendation # Install other things without recommendation
@ -419,6 +419,7 @@ systemctl enable rtl
systemctl enable tor systemctl enable tor
systemctl enable invalid_block_check systemctl enable invalid_block_check
systemctl enable usb_driver_check systemctl enable usb_driver_check
systemctl enable glances
# Regenerate MAC Address for Rock64 # Regenerate MAC Address for Rock64