Compare commits
12 Commits
main
...
webserver-
| Author | SHA1 | Date |
|---|---|---|
|
|
16a317951a | |
|
|
708c2eaa61 | |
|
|
2ecdea2236 | |
|
|
1da8548d8f | |
|
|
929c88dd86 | |
|
|
4b0854d4db | |
|
|
143942386c | |
|
|
3b3678925b | |
|
|
ccc2d7291c | |
|
|
b15a64360d | |
|
|
80d33c18bf | |
|
|
82bf9b9f0a |
134
README.md
|
|
@ -1,83 +1,18 @@
|
|||
|
||||
|
||||
**HBmonitor is a "web dashboard" for HBlink by N0MJS.**
|
||||
|
||||
***This is version of HBMonitor V2 by SP2ONG 2019-2022***
|
||||
***This is version of HBMonitor V2 by SP2ONG 2019-2021***
|
||||
|
||||
The main difference between HBMonitor v1 and v2 is the layout, i.e. the main page shows condensed
|
||||
information and on the subpages, you can see the individual content that was shown on v1
|
||||
|
||||
I recommend not running HBmonitor on the same computer as HBlink3
|
||||
|
||||
HBmonitor tested on Debian v9,v10,v11
|
||||
HBmonitor tested on Debian v9 and v10
|
||||
|
||||
This version of HBMonv2 requires a web server like apache2, lighttpd and
|
||||
php support running on the server.
|
||||
This is version HBMonitor V2
|
||||
|
||||
|
||||
cd /opt
|
||||
git clone https://github.com/sp2ong/HBMonv2.git
|
||||
cd HBMonv2
|
||||
chmod +x install.sh
|
||||
./install.sh
|
||||
cp config_SAMPLE.py config.py
|
||||
edit config.py and change what you necessary
|
||||
|
||||
You need to copy the contents of the /opt/HBMonv2/html directory to
|
||||
the web server directory. Suppose your web server is available
|
||||
as http://dmrserver.org, copy the file to for example /var/www/html
|
||||
|
||||
If you copy files to /var/www/html/hbmon, HBMonitor will be
|
||||
accessible from http://dmrserver.org/hbmon
|
||||
|
||||
You can copy to /var/www/hbmon and start HBMonitor access by configuring
|
||||
virtual the web server for subdomains e.g. hbmon.dmrserver.org
|
||||
the access will then be http://hbmon.dmrserver.org
|
||||
|
||||
In the html/include/ directory there is a config.php file in which you
|
||||
set the color theme and name for your Dashboard.
|
||||
|
||||
In the html/include/config.php you can defined height of Server Activity
|
||||
window: 45px; 1 row, 60px 2 rows, 80px 3 rows:
|
||||
define("HEIGHT_ACTIVITY","45px");
|
||||
|
||||
In the html directory there is a buttons.html file that you can tune to menu keys
|
||||
|
||||
The logo image you can replace with file image in html directory img/logo.png
|
||||
cp utils/lastheard /etc/cron.daily/
|
||||
chmod +x /etc/cron.daily/lastheard
|
||||
cp utils/hbmon.service /lib/systemd/system/
|
||||
systemctl enable hbmon
|
||||
systemctl start hbmon
|
||||
systemctl status hbmon
|
||||
forward TCP port 9000 and web server port in firewall
|
||||
|
||||
Please setup your SYSTEM INFO subpage with the following instruction:
|
||||
|
||||
https://github.com/sp2ong/HBMonv2/tree/main/sysinfo
|
||||
|
||||
Please remember the table lastheard displays only station transmissions
|
||||
that are longer than 2 sec.
|
||||
use >=0 instead of >2 if you want to record all activities in line:
|
||||
|
||||
if int(float(p[9])) > 2:
|
||||
|
||||
If you want to have more than the last 15 entries in the Lastheard table
|
||||
change in the monitor.py file line from:
|
||||
|
||||
# maximum number of lists in lastheard on the main page
|
||||
if n == 15:
|
||||
to for example:
|
||||
if n == 25:
|
||||
|
||||
|
||||
I recommend that you do not use the BRIDGE_INC = True option to display bridge information
|
||||
(if you have multiple bridges displaying this information will increase the CPU load,
|
||||
try to use BRIDGES_INC = False in config.py)
|
||||
|
||||
|
||||
***************************************************************************************
|
||||
|
||||
The HBMonv2 version without use external web server like apache2 etc is still available:
|
||||
|
||||
cd /opt
|
||||
git clone https://github.com/sp2ong/HBMonv2.git
|
||||
cd HBMonv2
|
||||
|
|
@ -90,23 +25,46 @@ php support running on the server.
|
|||
systemctl enable hbmon
|
||||
systemctl start hbmon
|
||||
systemctl status hbmon
|
||||
forward TCP port 9000 and web server port 8080 in firewall
|
||||
forward TCP ports 8080 and 9000 in firewall
|
||||
|
||||
*****************************************************************************************
|
||||
---
|
||||
Please setup your SYSTEM INFO subpage with the following instruction:
|
||||
|
||||
https://github.com/sp2ong/HBMonv2/tree/main/sysinfo
|
||||
|
||||
If you use openbrige links, in config.py in OPB_FILTER enter NETWORK_ID to do not display
|
||||
unnecessary entries in LASTHEARD.
|
||||
|
||||
Please remember the table lastheard displays only station transmissions that are longer than 2 seconds.
|
||||
|
||||
If you don't want to have the lastheard list set in config.py:
|
||||
LASTHEARD_INC = False
|
||||
|
||||
If you want to have more than the last 15 entries in the Lastherad table
|
||||
change in the monitor.py file line from
|
||||
if n == 15:
|
||||
to for example:
|
||||
if n == 20:
|
||||
|
||||
After update distribution of Linux jinja2 to version 3.x you can find problem with run HBMonitor with error:
|
||||
I recommend using the following settings:
|
||||
WEB_AUTH = True
|
||||
in config.py and set a proper username and password in:
|
||||
WEB_USER = 'hblink'
|
||||
WEB_PASS = 'hblink'
|
||||
will provide access to more information about masters / peers / openbridge / monitor for users
|
||||
who know access Information.
|
||||
|
||||
ValueError: The 'monitor' package was not installed in a way that PackageLoader understands.
|
||||
The display of buttons configurations are in the directory templates/buttons.html file. Don't change
|
||||
the code in the first part that checks if you have WEB_AUTH settings in config.py
|
||||
If you want to add your own buttons put the code below the line
|
||||
<! --- Own buttons html code ->
|
||||
|
||||
The logo image you can replace with file image: img/logo.png
|
||||
|
||||
In config.py you can choose one of the predefined HBmonitor colors or define your own by entering the code in THEME_COLOR
|
||||
|
||||
In directory sysinfo/ you can find info on how to setup display SYSTEM Info data in Monitor.
|
||||
|
||||
|
||||
You must uninstall jinja2 and reinstalling with this version Jinja2==2.11.3
|
||||
|
||||
pip3 uninstall jinja2
|
||||
|
||||
and
|
||||
|
||||
pip3 install Jinja2==2.11.3
|
||||
If not need monitor online rules (I do not recommend please use in config.py BRIDGES_INC = False
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -118,16 +76,12 @@ Python 3 implementation of N0MJS HBmonitor for HBlink https://github.com/kc1awv/
|
|||
|
||||
Copyright (C) 2013-2018 Cortney T. Buffington, N0MJS <n0mjs@me.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
---
|
||||
|
||||
<img src="https://github.com/sp2ong/HBMonv2/raw/main/html/img/hbmon.png">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
REPORT_NAME = 'Dashboard of local DMR network' # Name of the monitored HBlink system
|
||||
#
|
||||
CONFIG_INC = True # Include HBlink stats
|
||||
HOMEBREW_INC = True # Display Homebrew Peers status
|
||||
LASTHEARD_INC = True # Display lastheard table on main page
|
||||
|
|
@ -7,13 +9,44 @@ EMPTY_MASTERS = False # Display Enable (True) or DISA
|
|||
HBLINK_IP = '127.0.0.1' # HBlink's IP Address
|
||||
HBLINK_PORT = 4321 # HBlink's TCP reporting socket
|
||||
FREQUENCY = 10 # Frequency to push updates to web clients
|
||||
WEB_SERVER_PORT = 8080 # Has to be above 1024 if you're not running as root
|
||||
CLIENT_TIMEOUT = 0 # Clients are timed out after this many seconds, 0 to disable
|
||||
|
||||
# Generally you don't need to use this but
|
||||
# if you don't want to show in lastherad received traffic from OBP link put NETWORK ID
|
||||
# for example: "260210,260211,260212"
|
||||
# Theme colors
|
||||
#
|
||||
# Green
|
||||
#THEME_COLOR = 'background-color:#4a8f3c;color:white;'
|
||||
|
||||
# Blue 1
|
||||
#THEME_COLOR = 'background-color:#2A659A;color:white;'
|
||||
|
||||
# Blue 2
|
||||
#THEME_COLOR = 'background-color:#43A6DF;color:white;'
|
||||
|
||||
# Blue Gradient 1
|
||||
THEME_COLOR = 'background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);color:white;'
|
||||
|
||||
# Blue Gradient 2
|
||||
#THEME_COLOR = 'background-image: linear-gradient(to bottom, #3333cc 0%, #265a88 100%);color:white;'
|
||||
|
||||
# Red Gradient
|
||||
#THEME_COLOR = 'background-image:linear-gradient(0deg, rgba(251,0,0,1) 0%, rgba(255,131,131,1) 50%, rgba(255,255,255,1) 100%);color:black;'
|
||||
|
||||
# Grey Gradient
|
||||
#THEME_COLOR = 'background-image: linear-gradient(to bottom, #3b3b3b 10%, #808080 100%);color:white;'
|
||||
|
||||
# Green Gradient
|
||||
#THEME_COLOR = 'background-image:linear-gradient(to bottom right,#d0e98d, #4e6b00);color:black;'
|
||||
#
|
||||
|
||||
# Put list of NETWORK_ID from OPB links to don't show in lastheard/monitor duplicat entry, for example: "260210,260211,260212"
|
||||
OPB_FILTER = ""
|
||||
|
||||
# Authorization of access to dashboard
|
||||
WEB_AUTH = True
|
||||
WEB_USER = 'hblink'
|
||||
WEB_PASS = 'hblink'
|
||||
|
||||
# Files and stuff for loading alias files for mapping numbers to names
|
||||
PATH = './' # MUST END IN '/'
|
||||
PEER_FILE = 'peer_ids.json' # Will auto-download
|
||||
|
|
@ -21,8 +54,7 @@ SUBSCRIBER_FILE = 'subscriber_ids.json' # Will auto-download
|
|||
TGID_FILE = 'talkgroup_ids.json' # User provided
|
||||
LOCAL_SUB_FILE = 'local_subscriber_ids.json' # User provided (optional, leave '' if you don't use it)
|
||||
LOCAL_PEER_FILE = 'local_peer_ids.json' # User provided (optional, leave '' if you don't use it)
|
||||
LOCAL_TGID_FILE = 'local_talkgroup_ids.json' # User provided (optional, leave '' if you don't use it)
|
||||
FILE_RELOAD = 15 # Number of days before we reload DMR-MARC database files
|
||||
FILE_RELOAD = 30 # Number of days before we reload DMR-MARC database files
|
||||
PEER_URL = 'https://database.radioid.net/static/rptrs.json'
|
||||
SUBSCRIBER_URL = 'https://database.radioid.net/static/users.json'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -1,78 +1,4 @@
|
|||
<?php
|
||||
include_once '../include/config.php';
|
||||
// Output CSS and not plain text
|
||||
header("Content-type: text/css");
|
||||
?>
|
||||
.link <?php echo "{".THEME_COLOR."}\n"; ?>
|
||||
.button <?php echo "{".THEME_COLOR."}\n"; ?>
|
||||
.dropbtn <?php echo "{".THEME_COLOR."}\n"; ?>
|
||||
|
||||
#lact {
|
||||
height:<?php echo HEIGHT_ACTIVITY; ?>;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border:none;
|
||||
}
|
||||
#rcorner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: middle;
|
||||
text-align:center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border: 1px solid LightGrey;
|
||||
background: #e9e9e9;
|
||||
font: 12pt arial, sans-serif;
|
||||
font-weight:bold;
|
||||
margin-top:2px;
|
||||
margin-right:0px;
|
||||
margin-left:0px;
|
||||
margin-bottom:0px;
|
||||
color:#002d62;
|
||||
white-space:normal;
|
||||
height: 100%;
|
||||
line-height:21px;
|
||||
}
|
||||
#rcornerh {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius:8px;
|
||||
-moz-border-radius:8px;
|
||||
-webkit-border-radius:8px;
|
||||
font: 9pt arial, sans-serif;
|
||||
font-weight:bold;
|
||||
color:white;
|
||||
height:25px;
|
||||
line-height:25px;
|
||||
<?php echo THEME_COLOR."\n"; ?>
|
||||
}
|
||||
|
||||
table, td, th {
|
||||
border: .5px solid #d0d0d0;
|
||||
padding: 2px;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
text-align:center;}
|
||||
tr.theme_color <?php echo "{".THEME_COLOR."}\n"; ?>
|
||||
th.theme_color <?php echo "{".THEME_COLOR."}\n"; ?>
|
||||
|
||||
html {
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
|
||||
table.log {background-color: #f0f0f0; border-collapse: collapse; border: 1px solid #C1DAD7; width: 100%;}
|
||||
th.log {height: 30px; text-align: center;}
|
||||
tr:nth-child(even).log {background-color: #fafafa;text-align: center;}
|
||||
td.log {font-family: Monospace; height: 20px;}
|
||||
|
||||
|
||||
a:link {
|
||||
color: #0066ff;
|
||||
|
|
@ -182,3 +108,5 @@ a:active {
|
|||
/* Show the dropdown menu on hover */
|
||||
.dropdown:hover .dropdown-content {display: block;}
|
||||
|
||||
table, td, th {border: .5px solid #d0d0d0; padding: 2px; border-collapse: collapse; text-align:center;}
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - STATUS</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="bridge"></p>
|
||||
</div>
|
||||
<div style="width: 1100px; margin-left:0px;">
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p></div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
<div style="width: 1100px;">
|
||||
<!-- HBMonitor buttons HTML code -->
|
||||
<a href="index.php"><button class="button link"> Home </button></a>
|
||||
<!--
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn"> Admin Area </button>
|
||||
<div class="dropdown-content">
|
||||
<a href="masters.php"> Masters </a>
|
||||
<a href="peers.php"> Peers </a>
|
||||
<a href="opb.php"> OpenBridge </a>
|
||||
<a href="bridges.php"> Bridges </a>
|
||||
<a href="moni.php"> Monitor </a>
|
||||
<a href="sinfo.php"> System Info </a>
|
||||
</div>
|
||||
</div>
|
||||
--->
|
||||
|
||||
<a href="masters.php"><button class="button link"> Masters </button></a>
|
||||
|
||||
<a href="peers.php"><button class="button link"> Peers </button></a>
|
||||
|
||||
<a href="opb.php"><button class="button link"> OpenBridge </button></a>
|
||||
|
||||
<a href="moni.php"><button class="button link"> Monitor </button></a>
|
||||
|
||||
<a href="sysinfo.php"><button class="button link"> System Info </button></a>
|
||||
|
||||
<a title="Lastheard long list" href="log.php"><button class="button link"> Lastheard </button></a>
|
||||
|
||||
<a href="info.php"><button class="button link"> Info </button></a>
|
||||
|
||||
<!--
|
||||
|
||||
<a href="bridges.php"><button class="button link"> Bridges </button></a>
|
||||
-->
|
||||
<!-- Own buttons HTML code -->
|
||||
|
||||
<!-- Example of buttons dropdown HTML code -->
|
||||
<!--
|
||||
<p></p>
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">Admin Area</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="masters.php">Master&Peer</a>
|
||||
<a href="opb.php">OpenBridge</a>
|
||||
<a href="moni.php">Monitor</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">Reflectors</button>
|
||||
<div class="dropdown-content">
|
||||
<a target='_blank' href="#">YSF Reflector</a>
|
||||
<a target='_blank' href="#">XLX950</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<p></p>
|
||||
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 372 KiB |
BIN
html/img/cpu.png
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 283 KiB |
BIN
html/img/hdd.png
|
Before Width: | Height: | Size: 12 KiB |
BIN
html/img/mem.png
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Report all errors except E_NOTICE
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
|
||||
|
||||
// Name of the monitored Dashboard
|
||||
define("REPORT_NAME","Dashboard of local DMR Network");
|
||||
|
||||
// Height of Server Activity window: 45px; 1 row, 60px 2 rows, 80px 3 rows
|
||||
define("HEIGHT_ACTIVITY","45px");
|
||||
|
||||
//
|
||||
// Theme colors define
|
||||
//
|
||||
// Green
|
||||
//define("THEME_COLOR","background-color:#4a8f3c;color:white;");
|
||||
|
||||
// Blue 1
|
||||
//define("THEME_COLOR","background-color:#2A659A;color:white;");
|
||||
|
||||
// Blue 2
|
||||
//define("THEME_COLOR","background-color:#43A6DF;color:white;");
|
||||
|
||||
// Blue Gradient 1
|
||||
define("THEME_COLOR","background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);color:white;");
|
||||
|
||||
// Blue Gradient 2
|
||||
//define("THEME_COLOR","background-image: linear-gradient(to bottom, #3333cc 0%, #265a88 100%);color:white;");
|
||||
|
||||
// Red Gradient
|
||||
//define("THEME_COLOR","background-image:linear-gradient(0deg, rgba(251,0,0,1) 0%, rgba(255,131,131,1) 50%, rgba(255,255,255,1) 100%);color:black;");
|
||||
|
||||
// Grey Gradient
|
||||
//define("THEME_COLOR","background-image: linear-gradient(to bottom, #3b3b3b 10%, #808080 100%);color:white;");
|
||||
|
||||
// Green Gradient
|
||||
//define("THEME_COLOR","background-image:linear-gradient(to bottom right,#d0e98d, #4e6b00);color:black;");
|
||||
//
|
||||
|
||||
?>
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - STATUS</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022 (v20211012)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="main"></p>
|
||||
</div>
|
||||
<!-- LOG monitor if you want on main page -->
|
||||
<!--
|
||||
<div style="width: 1100px; margin-left:0px;">
|
||||
<fieldset style="width: 1045px; margin-left:0px;margin-right:0px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Call log window :. </font></b></legend>
|
||||
<pre id="log" style="height: 20em; text-align: left; overflow-y: scroll; font-size:13px; background-color: #000000; color:#b1eee9;"></pre>
|
||||
</fieldset></div>
|
||||
-->
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a target="_blank" href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a title="HBMonv2 SP2ONG v20220312" target="_blank" href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
119
html/log.php
|
|
@ -1,119 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="30">
|
||||
<title>DMR Server monitor - STATUS</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1150px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<p align="middle">
|
||||
<div style="overflow-x:auto;">
|
||||
<center><fieldset style="background-color:#e0e0e0e0;margin-left:15px;margin-right:15px;margin-top:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<table style="border-collapse: collapse; border: 1px solid #C1DAD7; width: 100%;background-color:#f0f0f0;">
|
||||
<thead><tr><th colspan=9 style="height: 30px;font-size:18px;font-weight:bold;">LastHeard</th></tr></thead>
|
||||
<tr class="theme_color" style="height:35px; text-align: center;font-weight:bold;"><TH> Date<TH> Time<TH> Callsign (DMR-Id)<TH> Name<TH> TG#<TH> TG Name<TH>TX (s) <TH>Source
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
// logging extension "last heard list" for hbmonitor
|
||||
// developed by Heiko Amft,DL1BZ dl1bz@bzsax.de
|
||||
|
||||
// define array for CSV import of logfile
|
||||
$log_time=array();
|
||||
$transmit_timer=array();
|
||||
$calltype=array();
|
||||
$event=array();
|
||||
$system=array();
|
||||
$src_id=array();
|
||||
$src_name=array();
|
||||
$ts=array();
|
||||
$tg=array();
|
||||
$tgname=array();
|
||||
$user_id=array();
|
||||
$user_call=array();
|
||||
$user_name=array();
|
||||
|
||||
// define location and name of logfile
|
||||
// best practise is write logfile in the directory where this php script is saved because some php installations have problems to read files outside the webserver directories
|
||||
$handle = fopen("/opt/HBMonv2/log/lastheard.log","r");
|
||||
|
||||
// import to array
|
||||
while (($data = fgetcsv ($handle)) !==false)
|
||||
{
|
||||
$log_time[] = $data[0];
|
||||
$transmit_timer[] = $data[1];
|
||||
$calltype[] = $data[2];
|
||||
$event[] = $data[3];
|
||||
$system[] = $data[4];
|
||||
$src_id[] = $data[5];
|
||||
$src_name[] = $data[6];
|
||||
$ts[] = $data[7];
|
||||
$tg[] = $data[8];
|
||||
$tgname[] = $data[9];
|
||||
$user_id[] = $data[10];
|
||||
$user_call[] = $data[11];
|
||||
$user_name[] = $data[12];
|
||||
}
|
||||
|
||||
// define some macros for table output
|
||||
$s = "<TD class=\"log\">";
|
||||
$s_r = "<TD align=\"right\">";
|
||||
$s_m = "<TD align=\"center\">";
|
||||
|
||||
// output to html table from the newest entry to the oldest
|
||||
for ($i=count($log_time)-1; $i >= 0; $i--)
|
||||
|
||||
{
|
||||
// prepare date string for output in european format
|
||||
$split_date = substr($log_time[$i],0,10);
|
||||
$date_eu = explode("-", $split_date);
|
||||
|
||||
$ts[$i] = substr($ts[$i],-1);
|
||||
$tg[$i] = substr($tg[$i],2);
|
||||
|
||||
// define special character convert for number zero - we write calls with number zero with this character in logs in Germany
|
||||
$src_name[$i] = str_replace("0","Ø",$src_name[$i]);
|
||||
if (substr($user_call[$i],2,1)=="0") { $user_call[$i] = str_replace("0","Ø",$user_call[$i]); }
|
||||
|
||||
$log_time[$i]=substr($log_time[$i],0,19);
|
||||
|
||||
// thats a special thing for an Id comes without DMR-Id from PEGASUS project - it means we need to convert to "NoCall" thats for calls from source ECHOLINK
|
||||
if ($user_id[$i]=="1234567") {$user_call[$i] = "*NoCallsign*"; $user_id[$i]="-";}
|
||||
|
||||
// output table
|
||||
echo "<TR class=\"log\" style=\"height:25px; text-align: center;\">".$s.' '.$date_eu[2].".".$date_eu[1].".".$date_eu[0].$s.' '.substr($log_time[$i],11,5).$s.'<font color=#0066ff><b> '.$user_call[$i]."</b></font><font size=\"-1\"> (".$user_id[$i].")</font>".$s.'<font color=#002d62><b>'.TRIM($user_name[$i]).'</b></font>'.$s.'<font color=#b5651d><b>'.$tg[$i].'</b></font>'.$s.'<font color=green><b> '.$tgname[$i].'</b></font>'.$s."<center>".round($transmit_timer[$i])."</center>".$s.$system[$i]."</TR>\n";
|
||||
}
|
||||
|
||||
echo "\n</table></fieldset></div>";
|
||||
|
||||
// close logfile after parsing
|
||||
fclose ($handle);
|
||||
?>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a target="_blank" href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a title="HBMonv2 SP2ONG" target="_blank" href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor v2 SP2ONG 2019-2022 -->
|
||||
<font size="-2">© developed by DL1BZ as logging-extension of HBmonitor (2018,2019)</font><br>
|
||||
</p>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - Masters</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="masters"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server - Monitor</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="moni"></p>
|
||||
</div>
|
||||
<p></p>
|
||||
<!-- LOG monitor -->
|
||||
<div style="width: 1100px; margin-left:0px;">
|
||||
<fieldset style="background-color:#e0e0e0e0;width: 1045px; margin-left:0px;margin-right:0px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Call log :. </font></b></legend>
|
||||
<pre id="log" style="height: 40em; text-align: left; overflow-y: scroll; font-size:12px; background-color: #000000; color:#b1eee9;"></pre>
|
||||
</fieldset></div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
35
html/opb.php
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - OpenBridge</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="opb"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - Peers</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="peers"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="300">
|
||||
<title>DMR Server monitor - System Info</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<!--
|
||||
<div>
|
||||
<a target="_blank" href="esm/"><button class="button link"> eZ Server Monitor </button></a>
|
||||
</div>
|
||||
-->
|
||||
<fieldset style="background-color:#e0e0e0;display:inline-block;margin-left:20px;margin-right:20px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: System Info :. </font></b></legend>
|
||||
<center>
|
||||
<!-- Temp CPU -->
|
||||
<p><img alt="" src="img/tempC.png" /><p>
|
||||
<!-- Disk usage -->
|
||||
<p><img alt="" src="img/hdd.png" /><p>
|
||||
<!-- Memory usage -->
|
||||
<p><img alt="" src="img/mem.png" /><p>
|
||||
<!-- CPU loads -->
|
||||
<p><img alt="" src="img/cpu.png" /><p>
|
||||
<!-- Network traffic -->
|
||||
<p><img alt="" src="img/mrtg/localhost_2-day.png" /><p>
|
||||
</p></center>
|
||||
<font color=blue><b>BLUE</b></font> Outgoing Traffic in Bits per Second | <font color=green><b>GREEN</b></font> Incoming Traffic in Bits per Second
|
||||
</br>
|
||||
</fieldset>
|
||||
<br>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 563 B |
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"tgid": 1,
|
||||
"callsign": "TG Local 1",
|
||||
"id": "1"
|
||||
},
|
||||
{
|
||||
"tgid": 2,
|
||||
"callsign": "TG Local 2",
|
||||
"id": "2"
|
||||
}
|
||||
]
|
||||
}
|
||||
280
monitor.py
|
|
@ -41,6 +41,10 @@ from subprocess import check_call, CalledProcessError
|
|||
from twisted.internet.protocol import ReconnectingClientFactory, Protocol
|
||||
from twisted.protocols.basic import NetstringReceiver
|
||||
from twisted.internet import reactor, task
|
||||
from twisted.web.server import Site
|
||||
from twisted.web.resource import Resource
|
||||
from twisted.web.static import File
|
||||
from twisted.web import server, static
|
||||
|
||||
import base64
|
||||
|
||||
|
|
@ -100,13 +104,12 @@ WHITE = 'ffffff'
|
|||
WHITE2 = 'f9f9f9f9'
|
||||
YELLOW = 'fffccd'
|
||||
|
||||
URL_PATH = 'main'
|
||||
|
||||
# Define setup setings
|
||||
CTABLE['SETUP']['LASTHEARD'] = LASTHEARD_INC
|
||||
BTABLE['SETUP']['BRIDGES'] = BRIDGES_INC
|
||||
|
||||
# create empty systems list
|
||||
sys_list = []
|
||||
|
||||
# OPB Filter for lastheard
|
||||
def get_opbf():
|
||||
if len(OPB_FILTER) !=0:
|
||||
|
|
@ -310,7 +313,7 @@ def add_hb_peer(_peer_conf, _ctable_loc, _peer):
|
|||
# (9 char, but we are just software) see https://wiki.brandmeister.network/index.php/Homebrew/example/php2
|
||||
|
||||
if _peer_conf['TX_FREQ'].strip().isdigit() and _peer_conf['RX_FREQ'].strip().isdigit() and str(type(_peer_conf['TX_FREQ'])).find("bytes") != -1 and str(type(_peer_conf['RX_FREQ'])).find("bytes") != -1:
|
||||
if _peer_conf['TX_FREQ'][:3] == b'000' or _peer_conf['TX_FREQ'][:1] == b'0' or _peer_conf['RX_FREQ'][:3] == b'000' or _peer_conf['RX_FREQ'][:1] == b'0':
|
||||
if _peer_conf['TX_FREQ'][:3] == b'000' or _peer_conf['RX_FREQ'][:3] == b'000':
|
||||
_ctable_peer['TX_FREQ'] = 'N/A'
|
||||
_ctable_peer['RX_FREQ'] = 'N/A'
|
||||
else:
|
||||
|
|
@ -347,16 +350,6 @@ def add_hb_peer(_peer_conf, _ctable_loc, _peer):
|
|||
else:
|
||||
_ctable_peer['LOCATION'] = _peer_conf['LOCATION']
|
||||
|
||||
if str(type(_peer_conf['DESCRIPTION'])).find("bytes") != -1:
|
||||
_ctable_peer['DESCRIPTION'] = _peer_conf['DESCRIPTION'].decode('utf-8').strip()
|
||||
else:
|
||||
_ctable_peer['DESCRIPTION'] = _peer_conf['DESCRIPTION']
|
||||
|
||||
if str(type(_peer_conf['URL'])).find("bytes") != -1:
|
||||
_ctable_peer['URL'] = _peer_conf['URL'].decode('utf-8').strip()
|
||||
else:
|
||||
_ctable_peer['URL'] = _peer_conf['URL']
|
||||
|
||||
if str(type(_peer_conf['CALLSIGN'])).find("bytes") != -1:
|
||||
_ctable_peer['CALLSIGN'] = _peer_conf['CALLSIGN'].decode('utf-8').strip()
|
||||
else:
|
||||
|
|
@ -406,7 +399,7 @@ def build_hblink_table(_config, _stats_table):
|
|||
for _peer in _hbp_data['PEERS']:
|
||||
add_hb_peer(_hbp_data['PEERS'][_peer], _stats_table['MASTERS'][_hbp]['PEERS'], _peer)
|
||||
|
||||
# Process Peer Systems
|
||||
# Proccess Peer Systems
|
||||
elif (_hbp_data['MODE'] == 'XLXPEER' or _hbp_data['MODE'] == 'PEER') and HOMEBREW_INC:
|
||||
_stats_table['PEERS'][_hbp] = {}
|
||||
_stats_table['PEERS'][_hbp]['MODE'] = _hbp_data['MODE']
|
||||
|
|
@ -415,16 +408,6 @@ def build_hblink_table(_config, _stats_table):
|
|||
_stats_table['PEERS'][_hbp]['LOCATION'] = _hbp_data['LOCATION'].decode('utf-8').strip()
|
||||
else:
|
||||
_stats_table['PEERS'][_hbp]['LOCATION'] = _hbp_data['LOCATION']
|
||||
|
||||
if str(type(_hbp_data['DESCRIPTION'])).find("bytes") != -1:
|
||||
_stats_table['PEERS'][_hbp]['DESCRIPTION'] = _hbp_data['DESCRIPTION'].decode('utf-8').strip()
|
||||
else:
|
||||
_stats_table['PEERS'][_hbp]['DESCRIPTION'] = _hbp_data['DESCRIPTION']
|
||||
|
||||
if str(type(_hbp_data['URL'])).find("bytes") != -1:
|
||||
_stats_table['PEERS'][_hbp]['URL'] = _hbp_data['DESCRIPTION'].decode('utf-8').strip()
|
||||
else:
|
||||
_stats_table['PEERS'][_hbp]['URL'] = _hbp_data['DESCRIPTION']
|
||||
|
||||
if str(type(_hbp_data['CALLSIGN'])).find("bytes") != -1:
|
||||
_stats_table['PEERS'][_hbp]['CALLSIGN'] = _hbp_data['CALLSIGN'].decode('utf-8').strip()
|
||||
|
|
@ -599,20 +582,26 @@ def build_bridge_table(_bridges):
|
|||
|
||||
build_time = time()
|
||||
def build_stats():
|
||||
global build_time
|
||||
global build_time, URL_PATH
|
||||
now = time()
|
||||
if True: #now > build_time + 1:
|
||||
if CONFIG:
|
||||
main = 'i' + itemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
|
||||
main = 'i' + itemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(main)
|
||||
peers = 'p' + ptemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
|
||||
peers = 'p' + ptemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(peers)
|
||||
masters = 'c' + ctemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'],emaster=EMPTY_MASTERS)
|
||||
masters = 'c' + ctemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH,emaster=EMPTY_MASTERS)
|
||||
dashboard_server.broadcast(masters)
|
||||
opb = 'o'+ otemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
|
||||
opb = 'o'+ otemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(opb)
|
||||
moni = 'm'+ mtemplate.render(themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(moni)
|
||||
info = 't'+ ttemplate.render(themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(info)
|
||||
sinfo = 's'+ stemplate.render(themec=THEME_COLOR,auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(sinfo)
|
||||
if BRIDGES and BRIDGES_INC and BTABLE['SETUP']['BRIDGES']:
|
||||
bridges = 'b' + btemplate.render(_table=BTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
|
||||
bridges = 'b' + btemplate.render(_table=BTABLE,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
|
||||
dashboard_server.broadcast(bridges)
|
||||
build_time = now
|
||||
|
||||
|
|
@ -661,10 +650,8 @@ def rts_update(p):
|
|||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['BGCOLOR'] = bgcolor
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TYPE'] = callType
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SUB'] = '{} ({})'.format(alias_short(sourceSub, subscriber_ids), sourceSub)
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['CALL'] = '{}'.format(alias_call(sourceSub, subscriber_ids))
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SRC'] = peer
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['DEST'] = 'TG {} {}'.format(destination,alias_tgid(destination,talkgroup_ids))
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TG'] = 'TG {}'.format(destination)
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TRX'] = crxstatus
|
||||
if action == 'END':
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TS'] = False
|
||||
|
|
@ -672,15 +659,13 @@ def rts_update(p):
|
|||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['BGCOLOR'] = WHITE2
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TYPE'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SUB'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['CALL'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SRC'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['DEST'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TG'] = ''
|
||||
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TRX'] = ''
|
||||
|
||||
if system in CTABLE['OPENBRIDGES']:
|
||||
if action == 'START':
|
||||
CTABLE['OPENBRIDGES'][system]['STREAMS'][streamId] = (trx, alias_call(sourceSub, subscriber_ids),'{}'.format(destination),timeout)
|
||||
CTABLE['OPENBRIDGES'][system]['STREAMS'][streamId] = (trx, alias_call(sourceSub, subscriber_ids),'TG {}'.format(destination),timeout)
|
||||
if action == 'END':
|
||||
if streamId in CTABLE['OPENBRIDGES'][system]['STREAMS']:
|
||||
del CTABLE['OPENBRIDGES'][system]['STREAMS'][streamId]
|
||||
|
|
@ -702,10 +687,8 @@ def rts_update(p):
|
|||
CTABLE['PEERS'][system][timeSlot]['COLOR'] = color
|
||||
CTABLE['PEERS'][system][timeSlot]['BGCOLOR'] = bgcolor
|
||||
CTABLE['PEERS'][system][timeSlot]['SUB'] = '{} ({})'.format(alias_short(sourceSub, subscriber_ids), sourceSub)
|
||||
CTABLE['PEERS'][system][timeSlot]['CALL'] = '{}'.format(alias_call(sourceSub, subscriber_ids))
|
||||
CTABLE['PEERS'][system][timeSlot]['SRC'] = sourcePeer
|
||||
CTABLE['PEERS'][system][timeSlot]['DEST'] = 'TG {} {}'.format(destination,alias_tgid(destination,talkgroup_ids))
|
||||
CTABLE['PEERS'][system][timeSlot]['TG'] = 'TG {}'.format(destination)
|
||||
CTABLE['PEERS'][system][timeSlot]['TRX'] = prxstatus
|
||||
if action == 'END':
|
||||
CTABLE['PEERS'][system][timeSlot]['TS'] = False
|
||||
|
|
@ -713,10 +696,8 @@ def rts_update(p):
|
|||
CTABLE['PEERS'][system][timeSlot]['BGCOLOR'] = WHITE2
|
||||
CTABLE['PEERS'][system][timeSlot]['TYPE'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['SUB'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['CALL'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['SRC'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['DEST'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['TG'] = ''
|
||||
CTABLE['PEERS'][system][timeSlot]['TRX'] = ''
|
||||
|
||||
build_stats()
|
||||
|
|
@ -759,32 +740,23 @@ def process_message(_bmessage):
|
|||
opbfilter = get_opbf()
|
||||
if p[0] == 'GROUP VOICE' and p[2] != 'TX' and p[5] not in opbfilter:
|
||||
if p[1] == 'END':
|
||||
start_sys=0
|
||||
for x in sys_list:
|
||||
if x[0]== p[3] and x[1] == p[4]:
|
||||
sys_list.pop()
|
||||
start_sys=1
|
||||
break
|
||||
if p[1] == 'END' and start_sys==1:
|
||||
log_message = '{} {} {} SYS: {:8.8s} SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s} Time: {}s '.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7],p[8],alias_tgid(int(p[8]),talkgroup_ids), p[6], alias_short(int(p[6]), subscriber_ids), int(float(p[9])))
|
||||
# log only to file if system is NOT OpenBridge event (not logging open bridge system, name depends on your OB definitions) AND transmit time is LONGER as 2sec (make sense for very short transmits)
|
||||
if LASTHEARD_INC:
|
||||
# save QSOs to lastheared.log for which transmission duration is longer than 2 sec,
|
||||
# use >=0 instead of >2 if you want to record all activities
|
||||
if int(float(p[9])) > 2:
|
||||
if int(float(p[9]))> 2:
|
||||
log_lh_message = '{},{},{},{},{},{},{},TS{},TG{},{},{},{}'.format(_now, p[9], p[0], p[1], p[3], p[5], alias_call(int(p[5]), subscriber_ids), p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
|
||||
lh_logfile = open(LOG_PATH+"lastheard.log", "a", encoding="UTF-8", errors="ignore")
|
||||
lh_logfile = open(LOG_PATH+"lastheard.log", "a")
|
||||
lh_logfile.write(log_lh_message + '\n')
|
||||
lh_logfile.close()
|
||||
# Lastheard in Dashboard by SP2ONG
|
||||
my_list=[]
|
||||
n=0
|
||||
f = open(PATH+"templates/lastheard.html", "w", encoding="UTF-8", errors="ignore")
|
||||
f = open(PATH+"templates/lastheard.html", "w")
|
||||
f.write("<br><fieldset style=\"border-radius: 8px; background-color:#f0f0f0f0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;\">\n")
|
||||
f.write("<legend><b><font color=\"#000\"> .: Lastheard :. </font></b></legend>\n")
|
||||
f.write("<table style=\"width:100%; font: 10pt arial, sans-serif;background-color:#f1f1f1;\">\n")
|
||||
f.write("<TR class=\"theme_color\" style=\" height: 32px;font: 10pt arial, sans-serif;\"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>System</TH></TR>\n")
|
||||
with open(LOG_PATH+"lastheard.log", "r", encoding="UTF-8", errors="ignore") as textfile:
|
||||
f.write("<TR style=\"height: 32px;font: 10pt arial, sans-serif;"+THEME_COLOR+"\"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>System</TH></TR>\n")
|
||||
with open(LOG_PATH+"lastheard.log", "r") as textfile:
|
||||
for row in islice(reversed(list(csv.reader(textfile))),200):
|
||||
duration=row[1]
|
||||
dur=str(int(float(duration.strip())))
|
||||
|
|
@ -802,31 +774,13 @@ def process_message(_bmessage):
|
|||
my_list.append(row[10])
|
||||
n += 1
|
||||
f.write(hline+"\n")
|
||||
# maximum number of lists in lastheard on the main page
|
||||
if n == 15:
|
||||
break
|
||||
f.write("</table></fieldset><br>")
|
||||
f.close()
|
||||
# End of Lastheard
|
||||
# Removing obsolete entries from the sys_list (3 sec)
|
||||
deleteList=[]
|
||||
processNo = 0
|
||||
timeO = datetime.datetime.now().timestamp()
|
||||
for item in sys_list:
|
||||
td = item[2] - timeO if item[2] > timeO else timeO - item[2]
|
||||
td = int(round(abs((td)) / 60))
|
||||
if td > 3:
|
||||
deleteList.insert(0,processNo)
|
||||
processNo +=1
|
||||
if len(deleteList) >0:
|
||||
for item in deleteList:
|
||||
del sys_list[item]
|
||||
# End of Lastheard
|
||||
elif p[1] == 'START':
|
||||
log_message = '{} {} {} SYS: {:8.8s} SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s}'.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7],p[8], alias_tgid(int(p[8]),talkgroup_ids), p[6], alias_short(int(p[6]), subscriber_ids))
|
||||
timeST = datetime.datetime.now().timestamp()
|
||||
sys_list.append([p[3],p[4],timeST])
|
||||
elif p[1] == 'END' and start_sys==0:
|
||||
log_message = '{} {} {} SYS: {:8.8s} SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s} Time: {}s '.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7],p[8],alias_tgid(int(p[8]),talkgroup_ids), p[6], alias_short(int(p[6]), subscriber_ids), int(float(p[9])))
|
||||
elif p[1] == 'END WITHOUT MATCHING START':
|
||||
log_message = '{} {} {} on SYSTEM {:8.8s}: SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s}'.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
|
||||
else:
|
||||
|
|
@ -899,7 +853,7 @@ class reportClientFactory(ReconnectingClientFactory):
|
|||
#
|
||||
|
||||
class dashboard(WebSocketServerProtocol):
|
||||
global INFO, MONITOR, OPENBRIDGE
|
||||
global URL_PATH, INFO, MONITOR, OPENBRIDGE
|
||||
def onConnect(self, request):
|
||||
logging.info('Client connecting: %s', request.peer)
|
||||
|
||||
|
|
@ -911,11 +865,14 @@ class dashboard(WebSocketServerProtocol):
|
|||
logging.info('WebSocket connection open.')
|
||||
self.factory.register(self)
|
||||
if BRIDGES and BRIDGES_INC and BTABLE['SETUP']['BRIDGES']:
|
||||
self.sendMessage(('b' + btemplate.render(_table=BTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])).encode('utf-8'))
|
||||
self.sendMessage(('c' + ctemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'],emaster=EMPTY_MASTERS)).encode('utf-8'))
|
||||
self.sendMessage(('p' + ptemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])).encode('utf-8'))
|
||||
self.sendMessage(('o' + otemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])).encode('utf-8'))
|
||||
self.sendMessage(('i' + itemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])).encode('utf-8'))
|
||||
self.sendMessage(('b' + btemplate.render(_table=BTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('c' + ctemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH,emaster=EMPTY_MASTERS)).encode('utf-8'))
|
||||
self.sendMessage(('p' + ptemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('o' + otemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('i' + itemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('m' + mtemplate.render(themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('t' + ttemplate.render(themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)).encode('utf-8'))
|
||||
self.sendMessage(('s' + stemplate.render(themec=THEME_COLOR,auth=WEB_AUTH)).encode('utf-8'))
|
||||
for _message in LOGBUF:
|
||||
if _message:
|
||||
_bmessage = ('l' + _message).encode('utf-8')
|
||||
|
|
@ -958,6 +915,104 @@ class dashboardFactory(WebSocketServerFactory):
|
|||
|
||||
######################################################################
|
||||
#
|
||||
# STATIC WEBSERVER
|
||||
#
|
||||
|
||||
class web_server(Resource):
|
||||
isLeaf = False
|
||||
|
||||
def getChild(self, name, request):
|
||||
return self
|
||||
|
||||
def render_GET(self, request):
|
||||
global BRIDGES_INC, URL_PATH
|
||||
logging.info('static website requested: %s', request)
|
||||
if WEB_AUTH and (request.uri == b'/masters' or request.uri == b'/peers' or request.uri == b'/opb' or request.uri == b'/moni' or request.uri == b'/bridges' or request.uri == b'/sinfo'):
|
||||
user = WEB_USER.encode('utf-8')
|
||||
password = WEB_PASS.encode('utf-8')
|
||||
auth = request.getHeader('Authorization')
|
||||
if auth and auth.split(' ')[0] == 'Basic':
|
||||
decodeddata = base64.b64decode(auth.split(' ')[1])
|
||||
if decodeddata.split(b':') == [user, password]:
|
||||
logging.info('Authorization OK')
|
||||
if request.uri == b'/bridges':
|
||||
URL_PATH = "bridges"
|
||||
BRIDGES_INC = True
|
||||
return (bridges_html).encode('utf-8')
|
||||
elif request.uri == b'/':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "main"
|
||||
return (main_html).encode('utf-8')
|
||||
elif request.uri == b'/masters':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "masters"
|
||||
return (masters_html).encode('utf-8')
|
||||
elif request.uri == b'/peers':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "peers"
|
||||
return (peers_html).encode('utf-8')
|
||||
elif request.uri == b'/opb':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "opb"
|
||||
return (opb_html).encode('utf-8')
|
||||
elif request.uri == b'/moni':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "moni"
|
||||
return (moni_html).encode('utf-8')
|
||||
elif request.uri == b'/info':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "info"
|
||||
return (info_html).encode('utf-8')
|
||||
elif request.uri == b'/sinfo':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "sinfo"
|
||||
return (sysinfo_html).encode('utf-8')
|
||||
else:
|
||||
return "Bad request".encode('utf-8')
|
||||
request.setResponseCode(401)
|
||||
request.setHeader('WWW-Authenticate', 'Basic realm="realmname"')
|
||||
logging.info('Someone wanted to get access without authorization')
|
||||
return "<html<head><head></head><body style=\"background-color: #EEEEEE;\"> \
|
||||
<script>setTimeout(function(){window.location.href='/';}, 5000);</script><br><br><br><center> \
|
||||
<fieldset style=\"width:600px;background-color:#e0e0e0e0;text-algin: center; margin-left:15px;margin-right:15px; \
|
||||
font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px; \
|
||||
border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;\"> \
|
||||
<p><font size=5><b>Authorization Required</font></p></filed></center></body></html>".encode('utf-8')
|
||||
else:
|
||||
if request.uri == b'/':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "main"
|
||||
return (main_html).encode('utf-8')
|
||||
elif request.uri == b'/bridges':
|
||||
URL_PATH = "bridges"
|
||||
BRIDGES_INC = True
|
||||
return (bridges_html).encode('utf-8')
|
||||
elif request.uri == b'/masters':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "masters"
|
||||
return (masters_html).encode('utf-8')
|
||||
elif request.uri == b'/peers':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "peers"
|
||||
return (peers_html).encode('utf-8')
|
||||
elif request.uri == b'/opb':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "opb"
|
||||
return (opb_html).encode('utf-8')
|
||||
elif request.uri == b'/moni':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "moni"
|
||||
return (moni_html).encode('utf-8')
|
||||
elif request.uri == b'/info':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "info"
|
||||
return (info_html).encode('utf-8')
|
||||
elif request.uri == b'/sinfo':
|
||||
BRIDGES_INC = False
|
||||
URL_PATH = "sinfo"
|
||||
return (sysinfo_html).encode('utf-8')
|
||||
else:
|
||||
return "Bad request".encode('utf-8')
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(
|
||||
|
|
@ -1008,11 +1063,6 @@ if __name__ == '__main__':
|
|||
logging.info('ID ALIAS MAPPER: local_subscriber_ids added to subscriber_ids dictionary')
|
||||
subscriber_ids.update(local_subscriber_ids)
|
||||
|
||||
local_talkgroup_ids = mk_full_id_dict(PATH, LOCAL_TGID_FILE, 'tgid')
|
||||
if local_talkgroup_ids:
|
||||
logging.info('ID ALIAS MAPPER: local_talkgroup_ids added to talkgroup_ids dictionary')
|
||||
talkgroup_ids.update(local_talkgroup_ids)
|
||||
|
||||
local_peer_ids = mk_full_id_dict(PATH, LOCAL_PEER_FILE, 'peer')
|
||||
if local_peer_ids:
|
||||
logging.info('ID ALIAS MAPPER: local_peer_ids added peer_ids dictionary')
|
||||
|
|
@ -1030,6 +1080,45 @@ if __name__ == '__main__':
|
|||
ctemplate = env.get_template('masters_table.html')
|
||||
otemplate = env.get_template('opb_table.html')
|
||||
btemplate = env.get_template('bridge_table.html')
|
||||
mtemplate = env.get_template('moni_table.html')
|
||||
ttemplate = env.get_template('info_table.html')
|
||||
stemplate = env.get_template('sysinfo_table.html')
|
||||
|
||||
|
||||
main_html = get_template(PATH + 'templates/index_template.html')
|
||||
main_html = main_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
main_html = main_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
|
||||
# Create Static Website index file
|
||||
bridges_html = get_template(PATH + 'templates/bridges_template.html')
|
||||
bridges_html = bridges_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
bridges_html = bridges_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
masters_html = get_template(PATH + 'templates/masters_template.html')
|
||||
masters_html = masters_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
masters_html = masters_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
peers_html = get_template(PATH + 'templates/peers_template.html')
|
||||
peers_html = peers_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
peers_html = peers_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
opb_html = get_template(PATH + 'templates/opb_template.html')
|
||||
opb_html = opb_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
opb_html = opb_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
moni_html = get_template(PATH + 'templates/moni_template.html')
|
||||
moni_html = moni_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
moni_html = moni_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
info_html = get_template(PATH + 'templates/info_template.html')
|
||||
info_html = info_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
info_html = info_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
sysinfo_html = get_template(PATH + 'templates/sysinfo_template.html')
|
||||
sysinfo_html = sysinfo_html.replace('<<<system_name>>>', REPORT_NAME)
|
||||
sysinfo_html = sysinfo_html.replace('<<<theme_color>>>', THEME_COLOR)
|
||||
|
||||
|
||||
|
||||
# Start update loop
|
||||
update_stats = task.LoopingCall(build_stats)
|
||||
|
|
@ -1042,24 +1131,21 @@ if __name__ == '__main__':
|
|||
|
||||
# Connect to HBlink
|
||||
reactor.connectTCP(HBLINK_IP, HBLINK_PORT, reportClientFactory())
|
||||
|
||||
|
||||
# HBmonitor does not require the use of SSL as no "sensitive data" is sent to it but if you want to use SSL:
|
||||
# create websocket server to push content to clients via SSL https://
|
||||
# the web server apache2 should be configured with a signed certificate for example Letsencrypt
|
||||
# we need install pyOpenSSL required by twisted: pip3 install pyOpenSSL
|
||||
# and add load ssl module in line number 43: from twisted.internet import reactor, task, ssl
|
||||
#
|
||||
# put certificate https://letsencrypt.org/ used in apache server
|
||||
#certificate = ssl.DefaultOpenSSLContextFactory('/etc/letsencrypt/live/hbmon.dmrserver.org/privkey.pem', '/etc/letsencrypt/live/hbmon.dmrserver.org/cert.pem')
|
||||
#dashboard_server = dashboardFactory('wss://*:9000')
|
||||
#dashboard_server.protocol = dashboard
|
||||
#reactor.listenSSL(9000, dashboard_server,certificate)
|
||||
# Create websocket server to push content to clients
|
||||
|
||||
# Create websocket server to push content to clients via http:// non SSL
|
||||
dashboard_server = dashboardFactory('ws://*:9000')
|
||||
dashboard_server.protocol = dashboard
|
||||
reactor.listenTCP(9000, dashboard_server)
|
||||
|
||||
# Create static web server to push initial index.html
|
||||
root = web_server()
|
||||
root.putChild(b'scripts',static.File(b"scripts/"))
|
||||
root.putChild(b'img', static.File(b"img/"))
|
||||
root.putChild(b'css', static.File(b"css/"))
|
||||
|
||||
website = Site(root)
|
||||
|
||||
reactor.listenTCP(WEB_SERVER_PORT, website)
|
||||
|
||||
reactor.run()
|
||||
|
|
|
|||
|
|
@ -7,12 +7,16 @@
|
|||
ellog = document.getElementById('log');
|
||||
|
||||
bridge_table = document.getElementById('bridge');
|
||||
info_table = document.getElementById('info');
|
||||
main_table = document.getElementById('main');
|
||||
masters_table = document.getElementById('masters');
|
||||
moni_table = document.getElementById('moni');
|
||||
opb_table = document.getElementById('opb');
|
||||
peers_table = document.getElementById('peers');
|
||||
sysinfo_table = document.getElementById('sinfo');
|
||||
|
||||
wsuri = (((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.hostname + ":9000");
|
||||
wsuri = "ws://" + window.location.hostname + ":9000";
|
||||
|
||||
|
||||
if ("WebSocket" in window) {
|
||||
sock = new WebSocket(wsuri);
|
||||
|
|
@ -33,10 +37,13 @@
|
|||
log("Connection closed (wasClean = " + e.wasClean + ", code = " + e.code + ", reason = '" + e.reason + "')");}
|
||||
sock = null;
|
||||
bridge_table.innerHTML = "";
|
||||
info_table.innerHTML = "";
|
||||
main_table.innerHTML = "";
|
||||
masters_table.innerHTML = "";
|
||||
moni_table.innerHTML = "";
|
||||
opb_table.innerHTML = "";
|
||||
peers_table.innerHTML = "";
|
||||
sysinfo_table.innerHTML = "";
|
||||
}
|
||||
sock.onmessage = function(e) {
|
||||
var opcode = e.data.slice(0,1);
|
||||
|
|
@ -47,20 +54,29 @@
|
|||
Cmsg(message);
|
||||
} else if (opcode == "i") {
|
||||
Imsg(message);
|
||||
} else if (opcode == "m") {
|
||||
Mmsg(message);
|
||||
} else if (opcode == "o") {
|
||||
Omsg(message);
|
||||
} else if (opcode == "p") {
|
||||
Pmsg(message);
|
||||
} else if (opcode == "t") {
|
||||
Tmsg(message);
|
||||
} else if (opcode == "s") {
|
||||
Smsg(message);
|
||||
} else if (opcode == "l") {
|
||||
if (ellog != null) {
|
||||
log(message);}
|
||||
} else if (opcode == "q") {
|
||||
log(message);
|
||||
bridge_table.innerHTML = "";
|
||||
info_table.innerHTML = "";
|
||||
main_table.innerHTML = "";
|
||||
masters_table.innerHTML = "";
|
||||
moni_table.innerHTML = "";
|
||||
opb_table.innerHTML = "";
|
||||
peers_table.innerHTML = "";
|
||||
sysinfo_table.innerHTML = "";
|
||||
} else {
|
||||
log("Unknown Message Received: " + message);
|
||||
}
|
||||
|
|
@ -71,8 +87,11 @@
|
|||
function Bmsg(_msg) {bridge_table.innerHTML = _msg;};
|
||||
function Cmsg(_msg) {masters_table.innerHTML = _msg;};
|
||||
function Imsg(_msg) {main_table.innerHTML = _msg;};
|
||||
function Mmsg(_msg) {moni_table.innerHTML = _msg;};
|
||||
function Omsg(_msg) {opb_table.innerHTML = _msg;};
|
||||
function Pmsg(_msg) {peers_table.innerHTML = _msg;};
|
||||
function Tmsg(_msg) {info_table.innerHTML = _msg;};
|
||||
function Smsg(_msg) {sysinfo_table.innerHTML = _msg;};
|
||||
|
||||
function log(_msg) {
|
||||
ellog.innerHTML += _msg + '\n';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -1,57 +1,4 @@
|
|||
Monitoring system
|
||||
==================
|
||||
|
||||
You can use and install ezSM tool to monitor your server instead described below method.
|
||||
The ezSM you can download from: https://www.ezservermonitor.com/
|
||||
|
||||
cd /var/www/html
|
||||
git clone https://github.com/shevabam/ezservermonitor-web.git
|
||||
mv ezservermonitor-web esm
|
||||
cd esm/conf/
|
||||
|
||||
Edit file esm.config.json and read documentation about configuration: https://www.ezservermonitor.com/esm-web/documentation
|
||||
Edit file /var/www/html/buttons.html and change link from
|
||||
|
||||
<a href="sysinfo.php"><button class="button link"> System Info </button></a>
|
||||
to:
|
||||
<a target=_blank href="esm/"><button class="button link"> System Info </button></a>
|
||||
|
||||
or you can add to sysinfo.php below line <?php include_once 'buttons.html'; ?> following html code:
|
||||
|
||||
<div>
|
||||
<a target="_blank" href="esm/"><button class="button link"> eZ Server Monitor </button></a>
|
||||
</div>
|
||||
|
||||
You can put in esm.config.json monitor services like HBMonitor, HBlink like:
|
||||
|
||||
"services": {
|
||||
"show_port": false,
|
||||
"list": [
|
||||
{
|
||||
"name": "Web Server",
|
||||
"host": "localhost",
|
||||
"port": 80,
|
||||
"protocol": "tcp"
|
||||
},
|
||||
{
|
||||
"name": "HBMonitor",
|
||||
"host": "localhost",
|
||||
"port": 9000,
|
||||
"protocol": "tcp"
|
||||
},
|
||||
{
|
||||
"name": "HBLink",
|
||||
"host": "localhost",
|
||||
"port": 4321,
|
||||
"protocol": "tcp"
|
||||
}
|
||||
|
||||
|
||||
|
||||
====================================================
|
||||
Alternative SYSInfo based on rrdtools and scripts
|
||||
====================================================
|
||||
Below is a description of how to monitor the system using rrdtools and scripts :
|
||||
|
||||
Install package:
|
||||
|
||||
|
|
@ -60,7 +7,7 @@ Install package:
|
|||
Change scripts to execute:
|
||||
|
||||
chmod +x /opt/HBMonv2/sysinfo/cpu.sh
|
||||
chmod +x /opt/HBMonv2/sysinfo/graph.sh
|
||||
chmod +x /opt/HBMonv2/sysinfo/grap.sh
|
||||
chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh
|
||||
|
||||
Run script create database
|
||||
|
|
@ -68,32 +15,21 @@ Run script create database
|
|||
cd /opt/HBMonv2/sysinfo
|
||||
./rrd-db.sh
|
||||
|
||||
|
||||
Edit file
|
||||
|
||||
/opt/HBMonv2/sysinfo/cpu.sh
|
||||
|
||||
Setup in WEB_PATH path to your web server html directory
|
||||
for example /var/www/html or /var/www/html/hbmon
|
||||
where is located your html files of HBMon
|
||||
|
||||
Edit file
|
||||
|
||||
/opt/HBMonv2/sysinfo/graph.sh
|
||||
|
||||
Setup in WEB_PATH path to your web server html directory
|
||||
for example /var/www/html or /var/www/html/hbmon
|
||||
where is located your html files of HBMon
|
||||
|
||||
|
||||
Setup temperature depend of your computer
|
||||
On raspberry pi or PC you can use sensors package to get temperature CPU
|
||||
|
||||
If you don't want to show temperature on the Pi, comment out the line that gets the temp
|
||||
If not avilable set:
|
||||
|
||||
tempcpu=false
|
||||
|
||||
For VPS set:
|
||||
|
||||
tempcpu=false
|
||||
|
||||
Copy file sysinfo-cron to /etc/cron.d/ and restart crontab
|
||||
/etc/init.d/cron restart
|
||||
|
||||
|
||||
Optional display network traffic
|
||||
===============================
|
||||
|
|
@ -123,16 +59,11 @@ Create config for mrtg:
|
|||
|
||||
cfgmaker -zero-speed=10000 public@localhost > /etc/mrtg.cfg
|
||||
|
||||
Please edit /etc/mrtg.cfg and change diretory to store image change WorkDir with
|
||||
path to your webserver html directory where is html files for HBMon:
|
||||
Please edit /etc/mrtg.cfg and change diretory to store image change WorkDir to:
|
||||
|
||||
WorkDir:/var/www/html/hbmon/img/mrtg
|
||||
|
||||
or
|
||||
|
||||
WorkDir:/var/www/html/img/mrtg
|
||||
WorkDir:/opt/HBMonv2/img/mrtg
|
||||
|
||||
Put below lines in section your network card
|
||||
put below lines in section your netrwork card
|
||||
and replace localhost_2 to your name network card as result cfgmaker generate in mrtg.cfg
|
||||
|
||||
XSize[localhost_2]: 600
|
||||
|
|
@ -141,6 +72,8 @@ and replace localhost_2 to your name network card as result cfgmaker generate in
|
|||
|
||||
Tune MaxBytes value for exmample 50000 to set vertical scale graph
|
||||
|
||||
Please edit template file where is which graph you are want display /var/www/html/sysinfo.php
|
||||
and check / verify name of img from mrtg: <img alt="" src="img/mrtg/localhost_2-day.png" />
|
||||
Please edit template file where is which graph you are want display /opt/HBMonv2/templates/sysinfo_template.html
|
||||
and check / verify name of img from mrtg: <img alt="" src="/img/mrtg/localhost_2-day.png" />
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Setup web server directory where is html files HBMon
|
||||
WEB_PATH='/var/www/html/'
|
||||
# Get values
|
||||
|
||||
|
||||
# CPU load
|
||||
load=`/bin/sed "s/\([0-9]\\.[0-9]\\{2\\}\)\ \([0-9]\\.[0-9]\\{2\\}\)\ \([0-9]\\.[0-9]\\{2\\}\).*/\1:\2:\3/" < /proc/loadavg`:`/usr/bin/head -n 1 /proc/stat | /bin/sed "s/^cpu\ \+\([0-9]*\)\ \([0-9]*\)\ \([0-9]*\).*/\1:\2:\3/"`
|
||||
|
|
@ -17,7 +17,7 @@ NOW=`date -u +%s`
|
|||
|
||||
|
||||
# CPU loads
|
||||
/usr/bin/rrdtool graph $WEB_PATH/img/cpu.png \
|
||||
/usr/bin/rrdtool graph /opt/HBMonv2/img/cpu.png \
|
||||
-Y -r -u 100 -l 0 -L 5 -v "CPU usage" -w 600 -h 70 -t "CPU status 24H - `/bin/date`" \
|
||||
-c ARROW\#000000 -x MINUTE:30:MINUTE:30:HOUR:1:0:%H \
|
||||
DEF:user=/opt/HBMonv2/sysinfo/load.rrd:cpuuser:AVERAGE \
|
||||
|
|
|
|||
|
|
@ -1,30 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Setup path web server directory where is html files of HBMon
|
||||
WEB_PATH='/var/www/html/'
|
||||
|
||||
# Get values
|
||||
|
||||
# Temperature CPU (not working for VPS)
|
||||
|
||||
# Disable = false or Enable = true create graph for temperature CPU
|
||||
# set "false" for VPS
|
||||
|
||||
tempcpu=false
|
||||
|
||||
# Setup temperature for CPU ============
|
||||
|
||||
# For Raspberry PI set tempcup=true and uncomnet below:
|
||||
#FILE=/sys/class/thermal/thermal_zone0/temp
|
||||
#if [[ -f "$FILE" ]] && $tempcpu == "True" ; then
|
||||
#tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1)}'`
|
||||
#fi
|
||||
|
||||
#For Raspberry PI, comment next 4 lines if you don't want temperature:
|
||||
|
||||
FILE=/sys/class/thermal/thermal_zone0/temp
|
||||
if [[ -f "$FILE" ]]; then
|
||||
tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1/1000)}'`
|
||||
fi
|
||||
# For platform not like Raspberry PI install package
|
||||
# apt install lm-sensors
|
||||
# and run command: sensors-detect
|
||||
# to setup sensors and
|
||||
# next check result run command: sensors
|
||||
# to see temperature CPU, if no set: tempcpu=false
|
||||
# if sensors return temperature CPU set: tempcpu=true
|
||||
|
||||
# For computers not like Raspberry PI install package
|
||||
# at install lm-sensors
|
||||
# and run: sensors-detect
|
||||
# after this check result run command: sensors to see temperature CPU
|
||||
|
||||
if [ -z "$tempC" ] ; then
|
||||
tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"`
|
||||
fi
|
||||
# For PC where used sensors tools uncomnet below:
|
||||
#if $tempcpu == "True" ; then
|
||||
#tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"`
|
||||
#fi
|
||||
|
||||
#=====================================
|
||||
|
||||
|
|
@ -42,7 +47,7 @@ NOW=`date -u +%s`
|
|||
|
||||
# Update db =====================================================
|
||||
|
||||
if [ -n "$tempC" ] ; then
|
||||
if $tempcpu == "True" ; then
|
||||
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/tempC.rrd $NOW:$tempC
|
||||
fi
|
||||
|
||||
|
|
@ -53,9 +58,9 @@ fi
|
|||
# Generate images ================================================================
|
||||
|
||||
|
||||
if [ -n "$tempC" ] ; then
|
||||
if $tempcpu == "True" ; then
|
||||
# Temperature CPU
|
||||
/usr/bin/rrdtool graph $WEB_PATH/img/tempC.png -t "Temperature CPU 24H - `/bin/date`" \
|
||||
/usr/bin/rrdtool graph /opt/HBMonv2/img/tempC.png -t "Temperature CPU 24H - `/bin/date`" \
|
||||
--rigid --alt-y-grid --alt-autoscale --units-exponent 0 \
|
||||
-w 600 -h 70 --upper-limit 100 --vertical-label 'Temperature [C]' --slope-mode --start -86400 \
|
||||
DEF:ave=/opt/HBMonv2/sysinfo/tempC.rrd:temp:AVERAGE \
|
||||
|
|
@ -92,7 +97,7 @@ DEF:tmin=/opt/HBMonv2/sysinfo/tempC.rrd:temp:MIN \
|
|||
fi
|
||||
|
||||
# Memory usage
|
||||
/usr/bin/rrdtool graph $WEB_PATH/img/mem.png -t "Memory usage 24H - `grep MemTotal /proc/meminfo | awk '{printf "%.0f MB", $2/1024}'` - `/bin/date`" \
|
||||
/usr/bin/rrdtool graph /opt/HBMonv2/img/mem.png -t "Memory usage 24H - Size: `grep MemTotal /proc/meminfo | awk '{printf "%.0f MB", $2/1024}'` - `/bin/date`" \
|
||||
--rigid --alt-y-grid --alt-autoscale --units-exponent 0 \
|
||||
-w 600 -h 70 --upper-limit 100 --vertical-label 'Memory usage [%]' --slope-mode --start -86400 \
|
||||
DEF:ave=/opt/HBMonv2/sysinfo/mem.rrd:mem:AVERAGE \
|
||||
|
|
@ -128,7 +133,7 @@ DEF:tmin=/opt/HBMonv2/sysinfo/mem.rrd:mem:MIN \
|
|||
'GPRINT:tmax:MAX:Maximum\: %2.1lf \j' >/dev/null
|
||||
|
||||
# Disk usage
|
||||
/usr/bin/rrdtool graph $WEB_PATH/img/hdd.png -t "Disk usage 24H - Size: `df -h / |awk 'NR==2 { print $2 }'` - `/bin/date`" \
|
||||
/usr/bin/rrdtool graph /opt/HBMonv2/img/hdd.png -t "Disk usage 24H - Size: `df -h / |awk 'NR==2 { print $2 }'` - `/bin/date`" \
|
||||
--rigid --alt-y-grid --alt-autoscale --units-exponent 0 \
|
||||
-w 600 -h 70 --upper-limit 100 --vertical-label 'Disk usage [%]' --slope-mode --start -86400 \
|
||||
DEF:ave=/opt/HBMonv2/sysinfo/hdd.rrd:hdd:AVERAGE \
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"tgid": 7,
|
||||
"callsign": "TG Local",
|
||||
"id": "7"
|
||||
},
|
||||
{
|
||||
"tgid": 9,
|
||||
"callsign": "TG XLX",
|
||||
"callsign": "TG Local",
|
||||
"country": "",
|
||||
"id": "9"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
<fieldset style="background-color:#e0e0e0e0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Bridge status :. </font></b></legend>
|
||||
{% if _table['BRIDGES']|length == 0 and _table['SETUP']['BRIDGES'] != False %}
|
||||
<table style='width:100%; font: 13pt arial, sans-serif'>
|
||||
<tr style='border:none; background-color:#f9f9f9f9;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the Server ...</center></b></td>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the HBLink server ...</center></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% elif _table['SETUP']['BRIDGES'] == False %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - BRIDGES</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 17px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="bridge"></p>
|
||||
</div>
|
||||
<div style="width: 1100px; margin-left:0px;">
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021)-->
|
||||
</p></div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<div style="width: 1100px;">
|
||||
<!-- HBMonitor buttons HTML code -->
|
||||
<a href="/"><button class="button link"> Home </button></a>
|
||||
{% if auth == True %}
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn"> Admin Area </button>
|
||||
<div class="dropdown-content">
|
||||
<a href="/masters"> Masters </a>
|
||||
<a href="/peers"> Peers </a>
|
||||
<a href="/opb"> OpenBridge </a>
|
||||
{% if dbridges == True %}
|
||||
<a href="/bridges"> Bridges </a>
|
||||
{% endif %}
|
||||
<a href="/moni"> Monitor </a>
|
||||
<a href="/sinfo"> System Info </a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
<a href="/masters"><button class="button link"> Masters </button></a>
|
||||
|
||||
<a href="/peers"><button class="button link"> Peers </button></a>
|
||||
|
||||
<a href="/opb"><button class="button link"> OpenBridge </button></a>
|
||||
{% if dbridges == True %}
|
||||
|
||||
<a href="/bridges"><button class="button link"> Bridges </button></a>
|
||||
{% endif %}
|
||||
|
||||
<a href="/moni"><button class="button link"> Monitor </button></a>
|
||||
|
||||
<a href="/sinfo"><button class="button link"> System Info </button></a>
|
||||
|
||||
{% endif %}
|
||||
<a href="/info"><button class="button link"> Info </button></a>
|
||||
|
||||
<!-- Own buttons HTML code -->
|
||||
<!-- link to long lastheard
|
||||
<a target='_blank' href="http://192.168.1.1/log.php"><button class="button link"> Lastheard </button></a>
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!-- Example of buttons dropdown HTML code -->
|
||||
<!--
|
||||
<p></p>
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">Admin Area</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="/masters">Master&Peer</a>
|
||||
<a href="/opb">OpenBridge</a>
|
||||
<a href="/moni">Monitor</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">Reflectors</button>
|
||||
<div class="dropdown-content">
|
||||
<a target='_blank' href="#">YSF Reflector</a>
|
||||
<a target='_blank' href="#">XLX950</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<p></p>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - STATUS</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v20210401)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img src="/img/logo.png?random=323527528432525.24234" alt="" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="main"></p>
|
||||
</div>
|
||||
<!-- LOG monitor -->
|
||||
<!--
|
||||
<div style="width: 1150px; margin-left:0px;">
|
||||
<fieldset style="width: 1100px; margin-left:0px;margin-right:0px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Call log window :. </font></b></legend>
|
||||
<pre id="log" style="height: 20em; text-align: left; overflow-y: scroll; font-size:13px; background-color: #000000; color:#b1eee9;"></pre>
|
||||
</fieldset></div>
|
||||
-->
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a target="_blank" href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a title="HBMonv2 SP2ONG v20210401" target="_blank" href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v20210401)-->
|
||||
</p>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
|
|
@ -1,32 +1,35 @@
|
|||
<?php
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
include_once 'include/config.php';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - Info</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.php" />
|
||||
<meta name="description" content="Copyright © 2016-2022.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2022" />
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-21.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1100px; text-align: center; margin-top:5px;">
|
||||
<img src="img/logo.png?random=323527528432525.24234" alt="" />
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<?php include_once 'buttons.html'; ?>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="info"></p>
|
||||
</div>
|
||||
<!-- TG table -->
|
||||
<div style="width: 1100px; margin-left:0px;">
|
||||
<fieldset style="box-shadow:0 0 10px #999;background-color:#e0e0e0e0; width:1050px;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Talk Groups :. </font></b></legend>
|
||||
<table style="margin-top:5px; table-layout:fixed; font: 10pt arial, sans-serif;background-color: #f9f9f9f9;">
|
||||
<tr class="theme_color" style=" height: 32px;font: 10pt arial, sans-serif;border:0;">
|
||||
<tr style=" height: 32px;font: 10pt arial, sans-serif;border:0;<<<theme_color>>>">
|
||||
<th style='width: 150px;'>TG#</th>
|
||||
<th style='width: 80px;'>TS 1</th>
|
||||
<th style='width: 80px;'>TS 2</th>
|
||||
|
|
@ -46,13 +49,13 @@ include_once 'include/config.php';
|
|||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<span style="text-align: center;">Hotspot: D - duplex | S - simplex</span>
|
||||
<span style="text-align: center;">Hotspot: D - duplex | S - smiplex</span>
|
||||
</fieldset></div><br>
|
||||
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright © 2016-2022<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2022</a><br><br></span>
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<br><fieldset style="border-radius: 8px; background-color:#f0f0f0f0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Lastheard :. </font></b></legend>
|
||||
<table style="width:100%; font: 10pt arial, sans-serif">
|
||||
<TR class="theme_color" style=" height: 32px;font: 10pt arial, sans-serif;"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>System</TH></TR>
|
||||
<TR style=" height: 32px;font: 10pt arial, sans-serif;background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);color:white;"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>Slot</TH><TH>System</TH></TR>
|
||||
</table></fieldset><br>
|
||||
|
|
|
|||
|
|
@ -1,61 +1,77 @@
|
|||
|
||||
<fieldset style="width:1045px;background-color:#f1f1f1;margin-left:5px;margin-right:5px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Server Activity :. </font></b></legend>
|
||||
{% include 'buttons.html' ignore missing %}
|
||||
<fieldset style="background-color:#f0f0f0f0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: DMR Server activity :. </font></b></legend>
|
||||
{% if _table['MASTERS']|length >0 %}
|
||||
<table width=100% style="background-color:#f0f0f0;border:none !important;border-collapse:collapse;border:none;">
|
||||
<tr style="height:30px;border-collapse:collapse; border:none;">
|
||||
<td width=100% style="border-collapse:collapse;border:none;"><div id="rcornerh">Active QSO's</div></td>
|
||||
<table style="table-layout:fixed;font: 10pt arial, sans-serif;margin-top:4px;margin-bottom:4px;" width=100%>
|
||||
<tr style="height:30px;font: 10pt arial, sans-serif;{{ themec }}">
|
||||
<th style='width: 20%;'>Systems M&P</th>
|
||||
<th style='width: 40%;'>Source</th>
|
||||
<th style='width: 40%;'>Destination</th>
|
||||
</tr>
|
||||
<tr style="border-collapse:collapse;border:none;">
|
||||
<td id="lact">
|
||||
<div id="rcorner"><div>
|
||||
{% for _master in _table['MASTERS'] %}
|
||||
{% for _master in _table['MASTERS'] %}
|
||||
{% for _client, _cdata in _table['MASTERS'][_master]['PEERS'].items() %}
|
||||
{% if _cdata[1]['TS'] == True or _cdata[2]['TS'] == True %}
|
||||
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
|
||||
{% if _cdata[1]['TRX'] == "RX" %}
|
||||
 [<span style="color:#008000;">M</span>: <span style="color:#0065ff;">{{ _cdata[1]['CALL']|safe }}</span>
|
||||
<font color=red>>></font> <span style="color:#b5651d;">{{ _cdata[1]['TG']|safe }}</span>]
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">M: {{_master}}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[1]['SUB']|safe }}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _cdata[1]['DEST']|safe }}</td>
|
||||
{% endif %}
|
||||
{% if _cdata[2]['TRX'] == "RX" %}
|
||||
 [<span style="color:#008000;">M</span>: <span style="color:#0065ff;">{{ _cdata[2]['CALL']|safe}}</span>
|
||||
<font color=red>>></font> <span style="color:#b5651d;">{{_cdata[2]['TG']|safe}}</span>]
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646">M: {{_master}}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[2]['SUB']|safe }}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _cdata[2]['DEST']|safe }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% else %}
|
||||
<table width=100%; style='background-color:#f9f9f9;font: 13pt arial, sans-serif; margin-top:4px;margin-bottom:4px;'>
|
||||
<tr style='border:none; background-color:#f0f0f0;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the Server ...</center></b></td>
|
||||
<table style='width:100%; font: 13pt arial, sans-serif; margin-top:4px;margin-bottom:4px;'>
|
||||
<tr style='border:none; background-color:#f9f9f9f9;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the DMR server ...</center></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% for _peer, _pdata in _table['PEERS'].items() %}
|
||||
{% if _pdata[1]['TS'] == True or _pdata[2]['TS'] == True %}
|
||||
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
|
||||
{% if _pdata[1]['TRX'] == "RX" %}
|
||||
 [<span style="color:#008000;">M</span>: <span style="color:#0065ff;">{{ _pdata[1]['CALL']|safe }}</span>
|
||||
<font color=red>>></font> <span style="color:#b5651d;">{{ _pdata[1]['TG']|safe }}</span>]
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">P: {{_peer}} </td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[1]['SUB']|safe }}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _pdata[1]['DEST']|safe }}</td>
|
||||
{% endif %}
|
||||
{% if _pdata[2]['TRX'] == "RX" %}
|
||||
 [<span style="color:#008000;">M</span>: <span style="color:#0065ff;">{{ _pdata[2]['CALL']|safe }}</span>
|
||||
<font color=red>>></font> <span style="color:#b5651d;">{{ _pdata[2]['TG']|safe }}</span>]
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">P: {{_peer}} </td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[2]['SUB']|safe }}</td>
|
||||
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _pdata[2]['DEST']|safe }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr style="background-color:#f9f9f9;" height="2px"><td colspan=3><hr style="padding:0px; margin:0px;border:none;color:#f9f9f9;background-color:#f9f9f9;"></td></tr>
|
||||
{% if _table['OPENBRIDGES']|length >0 %}
|
||||
<tr style="height:30px;width:100%; font: 10pt arial, sans-serif;{{ themec }}">
|
||||
<th style='width: 20%;'>Systems OpenBridge</th>
|
||||
<th colspan=2 style='width: 80%;'>Active Incoming Calls</th>
|
||||
</tr>
|
||||
{% for _openbridge in _table['OPENBRIDGES'] %}
|
||||
{% set rx = namespace(value=0) %}
|
||||
{% if _table['OPENBRIDGES'][_openbridge]['STREAMS']|length >0 %}
|
||||
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0]=='RX' %}
|
||||
{% set rx.value=1 %}
|
||||
{% endfor %}
|
||||
{% if rx.value == 1 %}
|
||||
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' %} [<span style="color:#008000;">O</span>: <font color=#0065ff>{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1]}}</font> <font color=red>>></font> <font color=#b5651d>TG {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2]|safe}}</font>] {% endfor %}
|
||||
{% if rx.value == 1 %}
|
||||
<tr style="background-color:#f9f9f9f9;line-height:1.6;">
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;"> {{ _openbridge}} </td>
|
||||
<td colspan=2 style="background-color:#f9f9f9f9; font: 9pt arial, sans-serif; font-weight: 600; color:#464646;">
|
||||
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' %}[<font color=#0065ff> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}</font> >> <font color=#b5651d> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>] {% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div></div></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</fieldset>
|
||||
|
|
@ -63,11 +79,10 @@
|
|||
{% include 'lastheard.html' ignore missing %}
|
||||
{% endif %}
|
||||
<fieldset style="background-color:#f0f0f0f0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Connected to Server :. </font></b></legend>
|
||||
<table style="table-layout:fixed;width:100%; font: 10pt arial, sans-serif;font-weight:600;margin-top:5px;margin-bottom:5px;border:none !important;border-collapse:collapse;border:none;" width=100%>
|
||||
<legend><b><font color="#000"> .: Connected to DMR Server :. </font></b></legend>
|
||||
<table style="table-layout:fixed;width:100%; font: 10pt arial, sans-serif;font-weight:600;margin-top:5px;margin-bottom:5px;" width=100%>
|
||||
{% if _table['MASTERS']|length >0 %}
|
||||
<tr style="border-collapse:collapse;border:none;"><td style="border-collapse:collapse;border:none;">
|
||||
<div style="background-color:#f9f9f9f9;background-image: linear-gradient(to bottom, #e9e9e9 50%, #bcbaba 100%);border-radius: 10px;-moz-border-radius:10px;-webkit-border-radius:10px;border: 1px solid LightGrey;">
|
||||
<tr style="background-color:#f9f9f9f9;"><td>
|
||||
<br>
|
||||
<div style="text-align:left;"><span style="color:#464646;font-weight:600;line-height:1.4;"> USERS:</span></div>
|
||||
<div style="text-align:left;font:9.5pt arial, sans-serif;font-weight:bold;margin-left:25px; margin-right:25px;line-height:1.4;white-space:normal;">
|
||||
|
|
@ -75,7 +90,7 @@
|
|||
{% if _table['MASTERS'][_master]['PEERS']|length >0 %}
|
||||
{% for _client, _cdata in _table['MASTERS'][_master]['PEERS'].items() %}
|
||||
<span class="tooltip" style="border-bottom: 1px dotted white;">
|
||||
<a style="border-bottom: 1px dotted white;font: 9.5pt arial,sans-serif;font-weight:bold;color:#0066ff;text-shadow: 1px 1px 1px Lightgrey, 0 0 0.5em LightGrey, 0 0 1em whitesmoke;" target="_blank" href="http://www.qrz.com/db/{{_cdata['CALLSIGN']}}"><b>{{_cdata['CALLSIGN']}}</b></a>
|
||||
<a style="border-bottom: 1px dotted white;font: 9.5pt arial,sans-serif;font-weight:bold;color:#0066ff;" target="_blank" href="http://www.qrz.com/db/{{_cdata['CALLSIGN']}}"><b>{{_cdata['CALLSIGN']}}</b></a>
|
||||
<span class="tooltiptext" style="left:115%;top:-10px;">
|
||||
<span style="font: 9pt arial,sans-serif;color:#FFFFFF">
|
||||
<b>DMR ID</b>: <b><font color=yellow>{{ _client }}</b></font><br>
|
||||
|
|
@ -87,8 +102,7 @@
|
|||
<b>Hardware</b>: {{_cdata['PACKAGE_ID'] }}
|
||||
<br> <b>Soft_Ver</b>: {{_cdata['SOFTWARE_ID'] }}
|
||||
<br> <b>Info</b>: {{_cdata['LOCATION']}}
|
||||
<br> <b>Master</b>: <font color=yellow>{{_master}}</font>
|
||||
<br> <b>Time connected</b>: <font color=yellow>{{ _cdata['CONNECTED'] }}</font>
|
||||
<br> <b>Master</b>: <font color=yellow>{{_master}}</font>
|
||||
</span></span></span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
@ -100,7 +114,7 @@
|
|||
<div style="text-align:left;"><span style="color:#464646;font-weight:600;line-height:1.8;"> PEERS:</span></div>
|
||||
<div style="text-align:left;font:9.5pt arial, sans-serif;font-weight:bold;margin-left:25px; margin-right:25px;line-height:1.6;white-space:normal;">
|
||||
{% for _peer, _pdata in _table['PEERS'].items() %}
|
||||
<span class="tooltip" style="margin-bottom:6px;border-bottom: 1px dotted white;{{'background-color:#8ecfb4; color:#464646;' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else 'background-color:#ff0000; color:white;'}}"><b> {{_peer}} </b>
|
||||
<span class="tooltip" style="bmargin-bottom:6px;order-bottom: 1px dotted white;{{'background-color:#8ecfb4; color:#464646;' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else 'background-color:#ff0000; color:white;'}}"><b> {{_peer}} </b>
|
||||
{% if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' %}
|
||||
<span class="tooltiptext" style="top:120%;left:50%;margin-left:-70%;width:100px;padding: 2px 0;">
|
||||
<center><font color=white>Connected</font></center>
|
||||
|
|
@ -115,5 +129,5 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
<br>
|
||||
</div></td></tr></table>
|
||||
</td></tr></table>
|
||||
</fieldset>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
<fieldset style="background-color:#e0e0e0e0; margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Masters status :. </font></b></legend>
|
||||
{% if _table['MASTERS']|length >0 %}
|
||||
<table style="table-layout:fixed;width:100%; font: 10pt arial, sans-serif; margin-top:5px; margin-bottom:5px;">
|
||||
<tr class="theme_color" style="font: 10pt arial, sans-serif;">
|
||||
<tr style="font: 10pt arial, sans-serif;{{ themec }}">
|
||||
<th style='width: 120px;'>HB Protocol<br>Master Systems</th>
|
||||
<th style='width: 160px;'>Callsign (DMR Id)<br>Info</th>
|
||||
<th style='width: 90px;'>Time Connected</th>
|
||||
|
|
@ -48,7 +49,7 @@
|
|||
{% else %}
|
||||
<table style='width:100%; font: 13pt arial, sans-serif; margin-top:8px;margin-bottom:8px;'>
|
||||
<tr style='border:none; background-color:#f9f9f9f9;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the Server ...</center></b></td>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the DMR server ...</center></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - Masters</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="masters"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server - Monitor</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="moni"></p>
|
||||
</div>
|
||||
<p></p>
|
||||
<!-- LOG monitor -->
|
||||
<div style="width: 1150px; margin-left:0px;">
|
||||
<fieldset style="background-color:#e0e0e0e0;width: 1100px; margin-left:0px;margin-right:0px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Call log window :. </font></b></legend>
|
||||
<pre id="log" style="height: 40em; text-align: left; overflow-y: scroll; font-size:13px; background-color: #000000; color:#b1eee9;"></pre>
|
||||
</fieldset></div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,24 +1,25 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
<fieldset style="background-color:#e0e0e0e0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: OpenBridge status :. </font></b></legend>
|
||||
{% if _table['OPENBRIDGES']|length >0 %}
|
||||
<table style="table-layout:fixed;width:100%; font: 10pt arial, sans-serif; margin-top:5px; margin-bottom:5px;">
|
||||
<tr class="theme_color" style="width:100%; font: 10pt arial, sans-serif;">
|
||||
<tr style="width:100%; font: 10pt arial, sans-serif;{{ themec }}">
|
||||
<th style='width: 12%'>OpenBridge<br>Systems</th>
|
||||
<th style='width: 12%'>Network ID</th>
|
||||
<th style='width: 70%;'>Active QSOs</th>
|
||||
<th style='width: 70%;'>Active Calls</th>
|
||||
</tr>
|
||||
{% for _openbridge in _table['OPENBRIDGES'] %}
|
||||
<tr style="background-color:#f9f9f9f9;">
|
||||
<td style="font-weight:bold; padding-left: 20px; text-align:left;"> {{ _openbridge}} </td>
|
||||
<td><div style="font: 9pt arial, sans-serif;margin-top:3px;margin-bottom:3px;">Net ID: <span style="font: 9pt arial, sans-serif;font-weight:bold;">{{ _table['OPENBRIDGES'][_openbridge]['NETWORK_ID'] }}</td>
|
||||
<td style="background-color:#f9f9f9f9; font: 9pt arial, sans-serif; font-weight: 600; color:#464646;">{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] %}[<span style="{{ 'color:#008000;' if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' else 'color:red;' }}">{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] }}</span>: <font color=#0065ff> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}</font> >> <font color=#b5651d>TG {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2]|safe }}</font>] {% endfor %}</td>
|
||||
<td style="background-color:#f9f9f9f9; font: 9pt arial, sans-serif; font-weight: 600; color:#464646;">{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] %}[<span style="{{ 'color:#008000;' if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' else 'color:red;' }}">{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] }}</span>: <font color=#0065ff> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}</font> >> <font color=#b5651d> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>] {% endfor %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<table style='width:100%; font: 13pt arial, sans-serif'>
|
||||
<tr style='border:none; background-color:#f9f9f9f9;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from Server ... or not defined on Server</center></b></td>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the DMR server ... or not defined on DMR server</center></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - OpenBridge</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="opb"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
<fieldset style="background-color:#e0e0e0e0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: Peers status :. </font></b></legend>
|
||||
{% if _table['PEERS']|length >0 %}
|
||||
<table style="table-layout:fixed;width:100%; font: 10pt arial, sans-serif; margin-top:5px;margin-bottom:5px;">
|
||||
<tr class="theme_color" style="font: 10pt arial, sans-serif;">
|
||||
<tr style="font: 10pt arial, sans-serif;{{ themec }}">
|
||||
<th style='width: 120px;'>HB Protocol<br>Peer Systems</th>
|
||||
<th style='width: 160px;'>Callsign (DMR Id)<br>Info</th>
|
||||
<th style='width: 90px;'>Connected<br>TX/RX/Lost</th>
|
||||
|
|
@ -30,7 +31,7 @@
|
|||
{% else %}
|
||||
<table style='width:100%; font: 13pt arial, sans-serif; margin-top:8px;margin-bottom:8px;'>
|
||||
<tr style='border:none; background-color:#f9f9f9f9;'>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the Server ... or not defined on Server</center></b></td>
|
||||
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the DMR server ... or not defined on DMR server</center></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>DMR Server monitor - Peers</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p style="text-align:center;"></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="peers"></p>
|
||||
</div>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
{% include 'buttons.html' ignore missing %}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="300">
|
||||
<title>DMR Server monitor - System Info</title>
|
||||
<script type="text/javascript" src="scripts/hbmon.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css" />
|
||||
<style>
|
||||
.link {<<<theme_color>>>}
|
||||
.button { <<<theme_color>>> }
|
||||
.dropbtn { <<<theme_color>>> }
|
||||
</style>
|
||||
<meta name="description" content="Copyright (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v2021)" />
|
||||
</head>
|
||||
<body style="background-color: #d0d0d0;font: 10pt arial, sans-serif;">
|
||||
<center><div style="width:1250px; text-align: center; margin-top:5px;">
|
||||
<img alt="" src="/img/logo.png" />
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><<<system_name>>></span></p>
|
||||
<p></p>
|
||||
</div>
|
||||
<div style="width: 1100px;">
|
||||
<noscript>You must enable JavaScript</noscript>
|
||||
<p id="sinfo"></p>
|
||||
</div>
|
||||
<fieldset style="background-color:#e0e0e0;display:inline-block;margin-left:20px;margin-right:20px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||
<legend><b><font color="#000"> .: System Info :. </font></b></legend>
|
||||
<center>
|
||||
<!-- Temp CPU -->
|
||||
<p><img alt="" src="/img/tempC.png" /><p>
|
||||
<!-- Disk usage -->
|
||||
<p><img alt="" src="/img/hdd.png" /><p>
|
||||
<!-- Memory usage -->
|
||||
<p><img alt="" src="/img/mem.png" /><p>
|
||||
<!-- CPU loads -->
|
||||
<p><img alt="" src="/img/cpu.png" /><p>
|
||||
<!-- Network traffic -->
|
||||
<p><img alt="" src="/img/mrtg/localhost_2-day.png" /><p>
|
||||
</p></center>
|
||||
<font color=blue><b>BLUE</b></font> Outgoing Traffic in Bits per Second | <font color=green><b>GREEN</b></font> Incoming Traffic in Bits per Second
|
||||
</br>
|
||||
</fieldset>
|
||||
<br>
|
||||
<p style="text-align: center;"><span style="text-align: center;">
|
||||
Copyright (c) 2016-2021<br>The Regents of the <a href=http://k0usy.mystrikingly.com/>K0USY Group</a>. All rights reserved.<br><a href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</a><br><br></span>
|
||||
<!-- THIS COPYRIGHT NOTICE MUST BE DISPLAYED AS A CONDITION OF THE LICENCE GRANT FOR THIS SOFTWARE. ALL DERIVATEIVES WORKS MUST CARRY THIS NOTICE -->
|
||||
<!-- This is version of HBMonitor SP2ONG 2019-2021 (v2021) -->
|
||||
</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# copy this file to /etc/cron.daily/
|
||||
|
||||
mv /opt/HBMonv2/log/lastheard.log /opt/HBMonv2/log/lastheard.log.save
|
||||
/usr/bin/tail -250 /opt/HBMonv2/log/lastheard.log.save > /opt/HBMonv2/log/lastheard.log
|
||||
mv /opt/HBMonv2/log/lastheard.log /opt/HBMonv2/log/lastheard.log.save
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
// logging extension "last heard list" for hbmonitor
|
||||
// developed by Heiko Amft,DL1BZ dl1bz@bzsax.de
|
||||
|
||||
// define array for CSV import of logfile
|
||||
$log_time=array();
|
||||
$transmit_timer=array();
|
||||
$calltype=array();
|
||||
$event=array();
|
||||
$system=array();
|
||||
$src_id=array();
|
||||
$src_name=array();
|
||||
$ts=array();
|
||||
$tg=array();
|
||||
$tgname=array();
|
||||
$user_id=array();
|
||||
$user_call=array();
|
||||
$user_name=array();
|
||||
|
||||
echo "<!DOCTYPE html>\n\n";
|
||||
echo "<html><Title>Last Heard HBlink</title>\n\n";
|
||||
echo "<head>";
|
||||
echo "<style>";
|
||||
echo "table { border-collapse: collapse; border: 1px solid #C1DAD7; width: 100%;}";
|
||||
echo "th { background-color: #9dc209; height: 30px; text-align: left; color: black;}";
|
||||
echo "tr:nth-child(even) { background-color: #fafafa; }";
|
||||
echo "td {font-family: Monospace; height: 20px;}";
|
||||
echo "a:link { text-decoration: none; }";
|
||||
echo "</style>";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"30\"></head>\n\n";
|
||||
echo "<body style=\"background-color:#EEEEEE;font:10pt arial, sans-serif\"><font face=\"arial,helvetica\"><font size=\"+1\">\n\n";
|
||||
echo "<H2 align=\"center\">Dashboard Activity & Last Heard HBlink</H2>";
|
||||
echo "<p align=\"middle\">\n";
|
||||
echo "<font size=\"-2\">© developed by DL1BZ as logging-extension of <A HREF=\"https://github.com/n0mjs710/HBmonitor\">HBmonitor</A> (2018,2019)</font><BR>\n";
|
||||
echo "<div style=\"overflow-x:auto;\">\n\n";
|
||||
echo "<center><fieldset style=\"background-color:#e0e0e0e0; width:1150px;margin-left:15px;margin-right:15px;margin-top:0px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;\">";
|
||||
echo "<table>\n\n";
|
||||
// define table row titels
|
||||
echo "<TR><TH> Date<TH> Time<TH> Callsign (DMR-Id)<TH> Name<TH> TG#<TH> TG Name<TH>TX (s) <TH> Slot <TH>Source</TR>\n\n";
|
||||
|
||||
// define location and name of logfile
|
||||
// best practise is write logfile in the directory where this php script is saved because some php installations have problems to read files outside the webserver directories
|
||||
$handle = fopen("/opt/HBMonv2/log/lastheard.log","r");
|
||||
|
||||
// import to array
|
||||
while (($data = fgetcsv ($handle)) !==false)
|
||||
{
|
||||
$log_time[] = $data[0];
|
||||
$transmit_timer[] = $data[1];
|
||||
$calltype[] = $data[2];
|
||||
$event[] = $data[3];
|
||||
$system[] = $data[4];
|
||||
$src_id[] = $data[5];
|
||||
$src_name[] = $data[6];
|
||||
$ts[] = $data[7];
|
||||
$tg[] = $data[8];
|
||||
$tgname[] = $data[9];
|
||||
$user_id[] = $data[10];
|
||||
$user_call[] = $data[11];
|
||||
$user_name[] = $data[12];
|
||||
}
|
||||
|
||||
// define some macros for table output
|
||||
$s = "<TD>";
|
||||
$s_r = "<TD align=\"right\">";
|
||||
$s_m = "<TD align=\"center\">";
|
||||
|
||||
// output to html table from the newest entry to the oldest
|
||||
for ($i=count($log_time)-1; $i >= 0; $i--)
|
||||
|
||||
{
|
||||
// prepare date string for output in european format
|
||||
$split_date = substr($log_time[$i],0,10);
|
||||
$date_eu = explode("-", $split_date);
|
||||
|
||||
$ts[$i] = substr($ts[$i],-1);
|
||||
$tg[$i] = substr($tg[$i],2);
|
||||
|
||||
// define special character convert for number zero - we write calls with number zero with this character in logs in Germany
|
||||
$src_name[$i] = str_replace("0","Ø",$src_name[$i]);
|
||||
if (substr($user_call[$i],2,1)=="0") { $user_call[$i] = str_replace("0","Ø",$user_call[$i]); }
|
||||
|
||||
$log_time[$i]=substr($log_time[$i],0,19);
|
||||
|
||||
// thats a special thing for an Id comes without DMR-Id from PEGASUS project - it means we need to convert to "NoCall" thats for calls from source ECHOLINK
|
||||
if ($user_id[$i]=="1234567") {$user_call[$i] = "*NoCallsign*"; $user_id[$i]="-";}
|
||||
|
||||
// output table
|
||||
echo "<TR>".$s.' '.$date_eu[2].".".$date_eu[1].".".$date_eu[0].$s.' '.substr($log_time[$i],11,5).$s.'<font color=#0066ff><b> '.$user_call[$i]."</b></font><font size=\"-1\"> (".$user_id[$i].")</font>".$s.TRIM($user_name[$i]).$s.'<font color=#b5651d><b>'.$tg[$i].'</b></font>'.$s.'<font color=green><b> '.$tgname[$i].'</b></font>'.$s."<center>".round($transmit_timer[$i])."</center>".$s."<center> ".$ts[$i]." </center>".$s.$system[$i]."</TR>\n";
|
||||
}
|
||||
|
||||
echo "\n</table></fieldset></div></body></html>";
|
||||
|
||||
// close logfile after parsing
|
||||
fclose ($handle);
|
||||
|
||||
?>
|
||||