Add HBMonv2

This commit is contained in:
Shane Daley 2021-10-12 20:57:31 +00:00
parent d1ece7f254
commit 67e6d62909
48 changed files with 3084 additions and 0 deletions

133
HBMonv2/README.md Normal file
View File

@ -0,0 +1,133 @@
**HBmonitor is a "web dashboard" for HBlink by N0MJS.**
***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 and v10
This version of HBMonv2 requires a web server like apache2, lighttpd and
php support running on the server.
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
git checkout webserver-python
chmod +x install.sh
./install.sh
cp config-SAMPLE.py config.py
edit config.py and change what you necessary
cp utils/hbmon.service /lib/systemd/system/
systemctl enable hbmon
systemctl start hbmon
systemctl status hbmon
forward TCP port 9000 and web server port 8080 in firewall
*****************************************************************************************
---
After update distribution of Linux jinja2 to version 3.x you can find problem with run HBMonitor with error:
ValueError: The 'monitor' package was not installed in a way that PackageLoader understands.
You must uninstall jinja2 and reinstalling with this version Jinja2==2.11.3
pip3 uninstall jinja2
and
pip3 install Jinja2==2.11.3
---
**hbmonitor3 by KC1AWV**
Python 3 implementation of N0MJS HBmonitor for HBlink https://github.com/kc1awv/hbmonitor3
---
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 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
---
<img src="https://github.com/sp2ong/HBMonv2/raw/main/html/img/hbmon.png">

31
HBMonv2/config_SAMPLE.py Normal file
View File

@ -0,0 +1,31 @@
CONFIG_INC = True # Include HBlink stats
HOMEBREW_INC = True # Display Homebrew Peers status
LASTHEARD_INC = True # Display lastheard table on main page
BRIDGES_INC = False # Display Bridge status and button
EMPTY_MASTERS = False # Display Enable (True) or DISABLE (False) empty masters in status
#
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
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"
OPB_FILTER = ""
# Files and stuff for loading alias files for mapping numbers to names
PATH = './' # MUST END IN '/'
PEER_FILE = 'peer_ids.json' # Will auto-download
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
PEER_URL = 'https://database.radioid.net/static/rptrs.json'
SUBSCRIBER_URL = 'https://database.radioid.net/static/users.json'
# Settings for log files
LOG_PATH = './log/' # MUST END IN '/'
LOG_NAME = 'hbmon.log'

35
HBMonv2/html/bridges.php Normal file
View File

@ -0,0 +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">
<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 (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v20210515)" />
</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;"><?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 (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>

60
HBMonv2/html/buttons.html Normal file
View File

@ -0,0 +1,60 @@
<div style="width: 1100px;">
<!-- HBMonitor buttons HTML code -->
<a href="index.php"><button class="button link">&nbsp;Home&nbsp;</button></a>
<!--
&nbsp;
<div class="dropdown">
<button class="dropbtn">&nbsp;Admin Area&nbsp;</button>
<div class="dropdown-content">
<a href="masters.php">&nbsp;Masters&nbsp;</a>
<a href="peers.php">&nbsp;Peers&nbsp;</a>
<a href="opb.php">&nbsp;OpenBridge&nbsp;</a>
<a href="bridges.php">&nbsp;Bridges&nbsp;</a>
<a href="moni.php">&nbsp;Monitor&nbsp;</a>
<a href="sinfo.php">&nbsp;System Info&nbsp;</a>
</div>
</div>
--->
&nbsp;
<a href="masters.php"><button class="button link">&nbsp;Masters&nbsp;</button></a>
&nbsp;
<a href="peers.php"><button class="button link">&nbsp;Peers&nbsp;</button></a>
&nbsp;
<a href="opb.php"><button class="button link">&nbsp;OpenBridge&nbsp;</button></a>
&nbsp;
<a href="moni.php"><button class="button link">&nbsp;Monitor&nbsp;</button></a>
&nbsp;
<a href="sysinfo.php"><button class="button link">&nbsp;System Info&nbsp;</button></a>
&nbsp;
<a title="Lastheard long list" href="log.php"><button class="button link">&nbsp;Lastheard&nbsp;</button></a>
&nbsp;
<a href="info.php"><button class="button link">&nbsp;Info&nbsp;</button></a>
&nbsp;
<!--
&nbsp;
<a href="bridges.php"><button class="button link">&nbsp;Bridges&nbsp;</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>
&nbsp;
<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>

View File

@ -0,0 +1,4 @@
<html>
<body>
</body>
</html>

184
HBMonv2/html/css/styles.php Normal file
View File

@ -0,0 +1,184 @@
<?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;
text-decoration: none;
}
/* visited link */
a:visited {
color: #0066ff;
text-decoration: none;
}
/* mouse over link */
a:hover {
color: hotpink;
text-decoration: underline;
}
/* selected link */
a:active {
color: #0066ff;
text-decoration: none;
}
.tooltip {
position: relative;
opacity: 1;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 280px;
background-color: #6E6E6E;
box-shadow: 4px 4px 6px #3b3b3b;
color: #FFFFFF;
text-align: left;
border-radius: 6px;
padding: 8px 0;
left: 100%;
opacity: 1;
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext {
right: 100%;
opacity: 1;
visibility: visible;
}
.button {
border: none;
padding: 8px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
font-weight: 500;
margin: 4px 2px;
border-radius: 8px;
box-shadow: 0px 8px 10px rgba(0,0,0,0.1);
}
.link:hover {background-color:rgb(140,140,140);background: rgb(140,140,140); color:white;}
.dropdown:hover .dropbtn {background-color:rgb(140,140,140);background: rgb(140,140,140); color:white;}
.dropbtn {
border: none;
padding: 8px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
font-weight: 500;
margin: 4px 2px;
border-radius: 8px;
box-shadow: 0px 8px 10px rgba(0,0,0,0.1);
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 140px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1000;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 6px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #ddd;}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {display: block;}

BIN
HBMonv2/html/img/HBlink.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

245
HBMonv2/html/img/HBlink.svg Normal file
View File

@ -0,0 +1,245 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0beta1 (d565813, 2019-09-28)"
sodipodi:docname="HBlink.svg"
id="svg877"
height="411.17413"
width="1042.9242"
viewBox="49.656 217.125 1042.9242 411.17414"
version="1.1">
<sodipodi:namedview
inkscape:current-layer="svg877"
inkscape:window-maximized="0"
inkscape:window-y="23"
inkscape:window-x="583"
inkscape:cy="48.366866"
inkscape:cx="574.39926"
inkscape:zoom="1"
fit-margin-left="5"
fit-margin-bottom="5"
fit-margin-right="5"
fit-margin-top="5"
units="px"
inkscape:pagecheckerboard="true"
showgrid="false"
id="namedview879"
inkscape:window-height="1348"
inkscape:window-width="1943"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
inkscape:document-rotation="0"
bordercolor="#666666"
pagecolor="#ffffff" />
<defs
id="defs837">
<font-face
overline-thickness="0"
overline-position="0"
strikethrough-thickness="0"
strikethrough-position="0"
v-hanging="0"
v-mathematical="0"
v-alphabetic="0"
v-ideographic="0"
hanging="0"
mathematical="0"
alphabetic="0"
ideographic="0"
accent-height="0"
stemh="0"
stemv="0"
id="font-face833"
font-weight="400"
descent="-255.00488"
ascent="945.0073"
cap-height="669"
x-height="669"
slope="0"
underline-thickness="20"
underline-position="-133"
units-per-em="1000"
panose-1="2 0 6 0 0 0 0 0 0 0"
font-size="96"
font-family="Ethnocentric">
<font-face-src>
<font-face-name
name="EthnocentricRg-Regular" />
</font-face-src>
</font-face>
<font-face
overline-thickness="0"
overline-position="0"
strikethrough-thickness="0"
strikethrough-position="0"
v-hanging="0"
v-mathematical="0"
v-alphabetic="0"
v-ideographic="0"
hanging="0"
mathematical="0"
alphabetic="0"
ideographic="0"
accent-height="0"
stemh="0"
stemv="0"
id="font-face835"
font-weight="400"
descent="-255.00488"
ascent="945.0073"
cap-height="669"
x-height="669"
slope="0"
underline-thickness="20"
underline-position="-133"
units-per-em="1000"
panose-1="2 0 6 0 0 0 0 0 0 0"
font-size="48"
font-family="Ethnocentric">
<font-face-src>
<font-face-name
name="EthnocentricRg-Regular" />
</font-face-src>
</font-face>
</defs>
<metadata
id="metadata839"> Produced by OmniGraffle 7.12.1
<dc:date>2018-03-14 13:37:44 +0000</dc:date>
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="matrix(3.5262508,0,0,3.5262508,-159.40153,-655.56235)"
stroke-opacity="1"
stroke="none"
stroke-dasharray="none"
fill-opacity="1"
fill="none"
id="Canvas_2">
<title
id="title841">Canvas 2</title>
<g
id="Canvas_2: Layer 1">
<title
id="title843">Layer 1</title>
<g
id="Group_40">
<g
id="Graphic_39">
<title
id="title845">path6007</title>
<path
inkscape:connector-curvature="0"
id="path847"
stroke-width="3"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#009051"
d="m 72.52062,328.5 h 225.5218 c 6.17355,0 11.1782,5.00465 11.1782,11.1782 v 0 c 0,6.17355 -5.00465,11.1782 -11.1782,11.1782 H 72.52062 c -6.17355,0 -11.1782,-5.00465 -11.1782,-11.1782 v 0 c 0,-6.17355 5.00465,-11.1782 11.1782,-11.1782 z" />
</g>
<g
id="Graphic_38">
<g
style="fill:#009051"
id="text852"
transform="translate(54.656,222.125)"
aria-label="HB">
<path
inkscape:connector-curvature="0"
id="path881"
style="font-weight:400;font-size:96px;font-family:Ethnocentric;fill:#009051"
d="M 84,91 H 64.224 V 66.232 H 26.016 V 91 H 6.048 V 26.776 H 26.016 V 49.528 H 64.224 V 26.776 H 84 Z" />
<path
inkscape:connector-curvature="0"
id="path883"
style="font-weight:400;font-size:96px;font-family:Ethnocentric;fill:#009051"
d="m 168.7155,57.976 q 4.224,1.248 7.104,4.896 2.976,3.648 2.976,9.408 0,4.032 -1.248,7.488 -1.248,3.36 -4.224,5.856 -2.976,2.496 -8.064,3.936 -4.992,1.44 -12.576,1.44 H 96.2355 V 51.928 h 56.832 q 2.208,0 3.84,-0.864 1.728,-0.96 1.728,-3.456 0,-2.4 -1.728,-3.264 -1.728,-0.864 -3.84,-0.864 h -56.832 l 13.44,-16.704 h 42.528 q 5.76,0 10.368,1.152 4.704,1.056 7.968,3.36 3.36,2.208 5.088,5.568 1.824,3.264 1.824,7.68 0,2.88 -0.768,5.088 -0.768,2.208 -2.016,3.936 -1.152,1.632 -2.784,2.784 -1.536,1.056 -3.168,1.632 z m -52.512,7.68 v 8.832 h 36.576 q 3.264,0 4.704,-1.152 1.44,-1.152 1.44,-3.36 0,-2.112 -1.44,-3.168 -1.44,-1.152 -4.704,-1.152 z" />
</g>
</g>
<g
id="Graphic_37">
<g
style="fill:#ff9300"
id="text857"
transform="translate(209.109,275)"
aria-label="link">
<path
inkscape:connector-curvature="0"
id="path886"
style="font-weight:400;font-size:48px;font-family:Ethnocentric;fill:#ff9300"
d="M 3.024,45 Z M 37.824,36.744 31.392,45 H 3.024 V 12.888 h 9.936 v 23.856 z" />
<path
inkscape:connector-curvature="0"
id="path888"
style="font-weight:400;font-size:48px;font-family:Ethnocentric;fill:#ff9300"
d="m 41.32425,45 z m 9.936,0 h -9.936 V 12.888 h 9.936 z" />
<path
inkscape:connector-curvature="0"
id="path890"
style="font-weight:400;font-size:48px;font-family:Ethnocentric;fill:#ff9300"
d="m 57.34875,45 z m 32.688,0.528 q -0.96,0 -1.92,-0.336 -0.912,-0.288 -2.064,-1.392 l -19.68,-17.664 V 45 h -9.024 V 18.36 q 0,-1.584 0.432,-2.736 0.48,-1.152 1.2,-1.872 0.768,-0.72 1.728,-1.056 1.008,-0.336 2.064,-0.336 0.912,0 1.824,0.336 0.96,0.288 2.16,1.392 l 19.68,17.664 V 12.888 h 9.072 V 39.48 q 0,1.584 -0.48,2.736 -0.432,1.152 -1.2,1.92 -0.72,0.72 -1.728,1.056 -1.008,0.336 -2.064,0.336 z" />
<path
inkscape:connector-curvature="0"
id="path892"
style="font-weight:400;font-size:48px;font-family:Ethnocentric;fill:#ff9300"
d="m 101.36775,45 z m 40.512,0 h -15.024 l -9.696,-8.448 q -2.496,-2.16 -3.84,-3.36 -1.296,-1.2 -2.112,-2.016 0.048,1.104 0.096,2.304 0.048,1.152 0.048,2.304 V 45 h -9.984 V 12.888 h 9.984 v 7.44 q 0,1.488 -0.048,2.928 -0.048,1.44 -0.144,2.688 0.96,-0.864 2.304,-2.112 1.392,-1.296 3.6,-3.12 l 9.264,-7.824 h 14.4 l -12.288,9.216 q -1.584,1.2 -2.832,2.112 -1.2,0.912 -2.16,1.584 -0.96,0.672 -1.776,1.2 -0.768,0.528 -1.536,1.008 1.392,0.96 3.36,2.4 1.968,1.44 5.088,3.984 z" />
</g>
</g>
<g
id="Graphic_36">
<path
inkscape:connector-curvature="0"
d="m 302.0625,336.9375 h 14.5771 v 6.1875 h -14.5771 z"
style="fill:#ffffff"
id="rect860" />
</g>
<g
id="Graphic_35">
<title
id="title863">path6381</title>
<path
inkscape:connector-curvature="0"
id="path865"
stroke-width="3"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#ff9300"
d="M 116.9282,340.3125 H 342.45 c 6.17355,0 11.1782,5.00465 11.1782,11.1782 v 0 c 0,6.17355 -5.00465,11.1782 -11.1782,11.1782 H 116.9282 c -6.17355,0 -11.1782,-5.00465 -11.1782,-11.1782 v 0 c 0,-6.17355 5.00465,-11.1782 11.1782,-11.1782 z" />
</g>
<g
id="Graphic_34">
<path
inkscape:connector-curvature="0"
d="m 99,347.625 h 14.5771 v 6.1875 H 99 Z"
style="fill:#ffffff"
id="rect868" />
</g>
<g
id="Line_33">
<path
inkscape:connector-curvature="0"
d="M 93.9375,350.85641 H 120.375"
style="stroke:#009051;stroke-width:3;stroke-linecap:round;stroke-linejoin:round"
id="line871" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
HBMonv2/html/img/cpu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
HBMonv2/html/img/hbmon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

BIN
HBMonv2/html/img/hdd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,4 @@
<html>
<body>
</body>
</html>

BIN
HBMonv2/html/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
HBMonv2/html/img/mem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,4 @@
<html>
<body>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
HBMonv2/html/img/tempC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@ -0,0 +1,41 @@
<?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;");
//
?>

View File

@ -0,0 +1,4 @@
<html>
<body>
</body>
</html>

45
HBMonv2/html/index.php Normal file
View File

@ -0,0 +1,45 @@
<?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 (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v20210712)" />
</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;"><?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 -->
<!--
<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">&nbsp;.: Call log window :.&nbsp;</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 v20210607" 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 (v20210712)-->
</p>
</div>
</center>
</body>
</html>

59
HBMonv2/html/info.php Normal file
View File

@ -0,0 +1,59 @@
<?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 - 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 (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: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;"><?php echo REPORT_NAME;?></span></p>
<p></p>
</div>
<?php include_once 'buttons.html'; ?>
<!-- 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">&nbsp;.: Talk Groups :.&nbsp;</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;">
<th style='width: 150px;'>TG#</th>
<th style='width: 80px;'>TS 1</th>
<th style='width: 80px;'>TS 2</th>
<th style='width: 790px;'>Description</th>
</tr>
<tr>
<td>&nbsp;<b>TG 5</b>&nbsp;</td>
<td>&nbsp;<b></b>&nbsp;</td>
<td>&nbsp;<b>D | S</b>&nbsp;</td>
<td>Talk group XLX132-D D-Star/DMR/C4FM.</td>
</tr>
<tr>
<td>&nbsp;<b>TG 9999</b>&nbsp;</td>
<td>&nbsp;<b></b>&nbsp;</td>
<td>&nbsp;<b>D | S</b>&nbsp;</td>
<td>Echo (Parrot).</td>
</tr>
</table>
<br>
<span style="text-align: center;">Hotspot: D - duplex | S - simplex</span>
</fieldset></div><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>

119
HBMonv2/html/log.php Normal file
View File

@ -0,0 +1,119 @@
<?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 (c) 2016-2021.The Regents of the K0USY Group. All rights reserved. Version SP2ONG 2019-2021 (v20210515)" />
</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: 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>&nbsp;&nbsp;Date<TH>&nbsp;Time<TH>&nbsp;Callsign (DMR-Id)<TH>&nbsp;&nbsp;Name<TH>&nbsp;TG#<TH>&nbsp;&nbsp;TG Name<TH>TX (s)&nbsp;<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","&Oslash;",$src_name[$i]);
if (substr($user_call[$i],2,1)=="0") { $user_call[$i] = str_replace("0","&Oslash;",$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.'&nbsp;'.$date_eu[2].".".$date_eu[1].".".$date_eu[0].$s.'&nbsp;'.substr($log_time[$i],11,5).$s.'<font color=#0066ff><b>&nbsp;'.$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>&nbsp;'.$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 (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" target="_blank" href=https://github.com/sp2ong/HBMonv2>Version SP2ONG 2019-2021</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-2021 (v20210515)-->
<font size="-2">&copy; developed by DL1BZ as logging-extension of HBmonitor (2018,2019)</font><br>
</p>
</div>
</center>
</body>
</html>

35
HBMonv2/html/masters.php Normal file
View File

@ -0,0 +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">
<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 (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 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 (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>

42
HBMonv2/html/moni.php Normal file
View File

@ -0,0 +1,42 @@
<?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 (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 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: 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">&nbsp;.: Call log window :.&nbsp;</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>

35
HBMonv2/html/opb.php Normal file
View File

@ -0,0 +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">
<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 (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 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 (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>

35
HBMonv2/html/peers.php Normal file
View File

@ -0,0 +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">
<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 (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 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 (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>

View File

@ -0,0 +1,79 @@
var sock = null;
var ellog = null;
window.onload = function() {
var wsuri;
ellog = document.getElementById('log');
bridge_table = document.getElementById('bridge');
main_table = document.getElementById('main');
masters_table = document.getElementById('masters');
opb_table = document.getElementById('opb');
peers_table = document.getElementById('peers');
wsuri = (((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.hostname + ":9000");
if ("WebSocket" in window) {
sock = new WebSocket(wsuri);
} else if ("MozWebSocket" in window) {
sock = new MozWebSocket(wsuri);
} else {
if (ellog != null) {
log("Browser does not support WebSocket!");}
}
if (sock) {
sock.onopen = function() {
if (ellog != null) {
log("Connected to " + wsuri);}
}
sock.onclose = function(e) {
if (ellog != null) {
log("Connection closed (wasClean = " + e.wasClean + ", code = " + e.code + ", reason = '" + e.reason + "')");}
sock = null;
bridge_table.innerHTML = "";
main_table.innerHTML = "";
masters_table.innerHTML = "";
opb_table.innerHTML = "";
peers_table.innerHTML = "";
}
sock.onmessage = function(e) {
var opcode = e.data.slice(0,1);
var message = e.data.slice(1);
if (opcode == "b") {
Bmsg(message);
} else if (opcode == "c") {
Cmsg(message);
} else if (opcode == "i") {
Imsg(message);
} else if (opcode == "o") {
Omsg(message);
} else if (opcode == "p") {
Pmsg(message);
} else if (opcode == "l") {
if (ellog != null) {
log(message);}
} else if (opcode == "q") {
log(message);
bridge_table.innerHTML = "";
main_table.innerHTML = "";
masters_table.innerHTML = "";
opb_table.innerHTML = "";
peers_table.innerHTML = "";
} else {
log("Unknown Message Received: " + message);
}
}
}
};
function Bmsg(_msg) {bridge_table.innerHTML = _msg;};
function Cmsg(_msg) {masters_table.innerHTML = _msg;};
function Imsg(_msg) {main_table.innerHTML = _msg;};
function Omsg(_msg) {opb_table.innerHTML = _msg;};
function Pmsg(_msg) {peers_table.innerHTML = _msg;};
function log(_msg) {
ellog.innerHTML += _msg + '\n';
ellog.scrollTop = ellog.scrollHeight;};

View File

@ -0,0 +1,4 @@
<html>
<body>
</body>
</html>

55
HBMonv2/html/sysinfo.php Normal file
View File

@ -0,0 +1,55 @@
<?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 (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 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">&nbsp;eZ Server Monitor&nbsp;</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">&nbsp;.: System Info :.&nbsp;</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>

6
HBMonv2/install.sh Normal file
View File

@ -0,0 +1,6 @@
#! /bin/bash
# Install the required support programs
apt-get install python3 python3-pip python3-dev libffi-dev libssl-dev cargo sed -y
pip3 install setuptools wheel
pip3 install -r requirements.txt

View File

@ -0,0 +1,14 @@
{
"results": [
{
"tgid": 1,
"callsign": "TG Local 1",
"id": "1"
},
{
"tgid": 2,
"callsign": "TG Local 2",
"id": "2"
}
]
}

1065
HBMonv2/monitor.py Normal file

File diff suppressed because it is too large Load Diff

6
HBMonv2/requirements.txt Normal file
View File

@ -0,0 +1,6 @@
Twisted
dmr_utils3
bitstring
autobahn
jinja2==2.11.3

146
HBMonv2/sysinfo/Readme.txt Normal file
View File

@ -0,0 +1,146 @@
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">&nbsp;System Info&nbsp;</button></a>
to:
<a target=_blank href="esm/"><button class="button link">&nbsp;System Info&nbsp;</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">&nbsp;eZ Server Monitor&nbsp;</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:
sudo apt-get install rrdtool -y
Change scripts to execute:
chmod +x /opt/HBMonv2/sysinfo/cpu.sh
chmod +x /opt/HBMonv2/sysinfo/graph.sh
chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh
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
Copy file sysinfo-cron to /etc/cron.d/ and restart crontab
/etc/init.d/cron restart
Optional display network traffic
===============================
Instal package mrtg and snmp
sudo apt-get install mrtg snmp snmpd -y
Edit file
/etc/snmp/snmpd.conf
and set as below
rocommunity public localhost
#rocommunity public default -V systemonly
#rocommunity6 public default -V systemonly
Restart snmpd
systemctl restart snmpd
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:
WorkDir:/var/www/html/hbmon/img/mrtg
or
WorkDir:/var/www/html/img/mrtg
Put below lines in section your network card
and replace localhost_2 to your name network card as result cfgmaker generate in mrtg.cfg
XSize[localhost_2]: 600
Options[localhost_2]: growright, bits
Unscaled[localhost_2]: d
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" />

33
HBMonv2/sysinfo/cpu.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
# Setup web server directory where is html files HBMon
WEB_PATH='/var/www/html/'
# 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/"`
# Get time
NOW=`date -u +%s`
# Update db =====================================================
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/load.rrd $NOW:$load
# Generate images ================================================================
# CPU loads
/usr/bin/rrdtool graph $WEB_PATH/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 \
DEF:nice=/opt/HBMonv2/sysinfo/load.rrd:cpunice:AVERAGE \
DEF:sys=/opt/HBMonv2/sysinfo/load.rrd:cpusystem:AVERAGE \
CDEF:idle=100,user,nice,sys,+,+,- \
COMMENT:" " \
AREA:user\#FF0000:"CPU user" \
STACK:nice\#000099:"CPU nice" \
STACK:sys\#FFFF00:"CPU system" \
STACK:idle\#00FF00:"CPU idle" \
COMMENT:" \j" >/dev/null

165
HBMonv2/sysinfo/graph.sh Executable file
View File

@ -0,0 +1,165 @@
#!/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)
# Setup temperature for CPU ============
#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 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
#=====================================
# Usage of hdd /
hdd=`df -h | awk '$NF=="/"{printf "%s",$5}'|sed 's/.$//'|awk '{printf("%.1f",$1)}'`
# Memory usage
mem=`free -m | awk 'NR==2{printf "%.1f", $3*100/$2 }'`
# 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/"`
# Get time
NOW=`date -u +%s`
# Update db =====================================================
if [ -n "$tempC" ] ; then
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/tempC.rrd $NOW:$tempC
fi
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/mem.rrd $NOW:$mem
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/hdd.rrd $NOW:$hdd
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/load.rrd $NOW:$load
# Generate images ================================================================
if [ -n "$tempC" ] ; then
# Temperature CPU
/usr/bin/rrdtool graph $WEB_PATH/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 \
CDEF:C=ave,100,GE,ave,0,IF AREA:C#7F0000: \
CDEF:D=ave,95,GE,ave,100,LT,ave,100,IF,0,IF AREA:D#9E0000: \
CDEF:E=ave,90,GE,ave,95,LT,ave,95,IF,0,IF AREA:E#BD0000: \
CDEF:F=ave,85,GE,ave,90,LT,ave,90,IF,0,IF AREA:F#DD0000: \
CDEF:G=ave,80,GE,ave,85,LT,ave,85,IF,0,IF AREA:G#FC0000: \
CDEF:H=ave,75,GE,ave,80,LT,ave,80,IF,0,IF AREA:H#FF1D00: \
CDEF:I=ave,70,GE,ave,75,LT,ave,75,IF,0,IF AREA:I#FC3D00: \
CDEF:J=ave,65,GE,ave,70,LT,ave,70,IF,0,IF AREA:J#FF5C00: \
CDEF:K=ave,60,GE,ave,65,LT,ave,65,IF,0,IF AREA:K#FF7C00: \
CDEF:L=ave,55,GE,ave,60,LT,ave,60,IF,0,IF AREA:L#FFBA00: \
CDEF:M=ave,50,GE,ave,55,LT,ave,55,IF,0,IF AREA:M#FFD900: \
CDEF:N=ave,45,GE,ave,50,LT,ave,50,IF,0,IF AREA:N#FFF900: \
CDEF:O=ave,40,GE,ave,45,LT,ave,45,IF,0,IF AREA:O#E5FF1A: \
CDEF:P=ave,35,GE,ave,40,LT,ave,40,IF,0,IF AREA:P#C6FF39: \
CDEF:Q=ave,30,GE,ave,35,LT,ave,35,IF,0,IF AREA:Q#A6FF58: \
CDEF:R=ave,25,GE,ave,30,LT,ave,30,IF,0,IF AREA:R#87FF78: \
CDEF:S=ave,20,GE,ave,25,LT,ave,25,IF,0,IF AREA:S#69FE96: \
CDEF:T=ave,15,GE,ave,20,LT,ave,20,IF,0,IF AREA:T#49FEB6: \
CDEF:U=ave,10,GE,ave,15,LT,ave,15,IF,0,IF AREA:U#2AFED5: \
CDEF:VV=ave,5,GE,ave,10,LT,ave,10,IF,0,IF AREA:VV#0BFFF4: \
CDEF:WW=ave,0,GE,ave,5,LT,ave,5,IF,0,IF AREA:WW#0BFFF4: \
CDEF:A=ave \
VDEF:V=ave,AVERAGE \
LINE1:ave \
LINE1:A#000000:Temperature \
DEF:tmax=/opt/HBMonv2/sysinfo/tempC.rrd:temp:MAX \
DEF:tmin=/opt/HBMonv2/sysinfo/tempC.rrd:temp:MIN \
'GPRINT:ave:LAST:Last\: %2.1lf C' \
'GPRINT:tmin:MIN:Minimum\: %2.1lf C' \
'GPRINT:tmax:MAX:Maximum\: %2.1lf C\j' >/dev/null
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`" \
--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 \
CDEF:C=ave,100,GE,ave,0,IF AREA:C#7F0000: \
CDEF:D=ave,95,GE,ave,100,LT,ave,100,IF,0,IF AREA:D#9E0000: \
CDEF:E=ave,90,GE,ave,95,LT,ave,95,IF,0,IF AREA:E#BD0000: \
CDEF:F=ave,85,GE,ave,90,LT,ave,90,IF,0,IF AREA:F#DD0000: \
CDEF:G=ave,80,GE,ave,85,LT,ave,85,IF,0,IF AREA:G#FC0000: \
CDEF:H=ave,75,GE,ave,80,LT,ave,80,IF,0,IF AREA:H#FF1D00: \
CDEF:I=ave,70,GE,ave,75,LT,ave,75,IF,0,IF AREA:I#FC3D00: \
CDEF:J=ave,65,GE,ave,70,LT,ave,70,IF,0,IF AREA:J#FF5C00: \
CDEF:K=ave,60,GE,ave,65,LT,ave,65,IF,0,IF AREA:K#FF7C00: \
CDEF:L=ave,55,GE,ave,60,LT,ave,60,IF,0,IF AREA:L#FFBA00: \
CDEF:M=ave,50,GE,ave,55,LT,ave,55,IF,0,IF AREA:M#FFD900: \
CDEF:N=ave,45,GE,ave,50,LT,ave,50,IF,0,IF AREA:N#FFF900: \
CDEF:O=ave,40,GE,ave,45,LT,ave,45,IF,0,IF AREA:O#E5FF1A: \
CDEF:P=ave,35,GE,ave,40,LT,ave,40,IF,0,IF AREA:P#C6FF39: \
CDEF:Q=ave,30,GE,ave,35,LT,ave,35,IF,0,IF AREA:Q#A6FF58: \
CDEF:R=ave,25,GE,ave,30,LT,ave,30,IF,0,IF AREA:R#87FF78: \
CDEF:S=ave,20,GE,ave,25,LT,ave,25,IF,0,IF AREA:S#69FE96: \
CDEF:T=ave,15,GE,ave,20,LT,ave,20,IF,0,IF AREA:T#49FEB6: \
CDEF:U=ave,10,GE,ave,15,LT,ave,15,IF,0,IF AREA:U#2AFED5: \
CDEF:VV=ave,5,GE,ave,10,LT,ave,10,IF,0,IF AREA:VV#0BFFF4: \
CDEF:WW=ave,0,GE,ave,5,LT,ave,5,IF,0,IF AREA:WW#0BFFF4: \
CDEF:A=ave \
VDEF:V=ave,AVERAGE \
LINE1:ave \
LINE1:A#000000:Memory_usage_% \
DEF:tmax=/opt/HBMonv2/sysinfo/mem.rrd:mem:MAX \
DEF:tmin=/opt/HBMonv2/sysinfo/mem.rrd:mem:MIN \
'GPRINT:ave:LAST:Last\: %2.1lf ' \
'GPRINT:tmin:MIN:Minimum\: %2.1lf ' \
'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`" \
--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 \
CDEF:C=ave,100,GE,ave,0,IF AREA:C#7F0000: \
CDEF:D=ave,95,GE,ave,100,LT,ave,100,IF,0,IF AREA:D#9E0000: \
CDEF:E=ave,90,GE,ave,95,LT,ave,95,IF,0,IF AREA:E#BD0000: \
CDEF:F=ave,85,GE,ave,90,LT,ave,90,IF,0,IF AREA:F#DD0000: \
CDEF:G=ave,80,GE,ave,85,LT,ave,85,IF,0,IF AREA:G#FC0000: \
CDEF:H=ave,75,GE,ave,80,LT,ave,80,IF,0,IF AREA:H#FF1D00: \
CDEF:I=ave,70,GE,ave,75,LT,ave,75,IF,0,IF AREA:I#FC3D00: \
CDEF:J=ave,65,GE,ave,70,LT,ave,70,IF,0,IF AREA:J#FF5C00: \
CDEF:K=ave,60,GE,ave,65,LT,ave,65,IF,0,IF AREA:K#FF7C00: \
CDEF:L=ave,55,GE,ave,60,LT,ave,60,IF,0,IF AREA:L#FFBA00: \
CDEF:M=ave,50,GE,ave,55,LT,ave,55,IF,0,IF AREA:M#FFD900: \
CDEF:N=ave,45,GE,ave,50,LT,ave,50,IF,0,IF AREA:N#FFF900: \
CDEF:O=ave,40,GE,ave,45,LT,ave,45,IF,0,IF AREA:O#E5FF1A: \
CDEF:P=ave,35,GE,ave,40,LT,ave,40,IF,0,IF AREA:P#C6FF39: \
CDEF:Q=ave,30,GE,ave,35,LT,ave,35,IF,0,IF AREA:Q#A6FF58: \
CDEF:R=ave,25,GE,ave,30,LT,ave,30,IF,0,IF AREA:R#87FF78: \
CDEF:S=ave,20,GE,ave,25,LT,ave,25,IF,0,IF AREA:S#69FE96: \
CDEF:T=ave,15,GE,ave,20,LT,ave,20,IF,0,IF AREA:T#49FEB6: \
CDEF:U=ave,10,GE,ave,15,LT,ave,15,IF,0,IF AREA:U#2AFED5: \
CDEF:VV=ave,5,GE,ave,10,LT,ave,10,IF,0,IF AREA:VV#0BFFF4: \
CDEF:WW=ave,0,GE,ave,5,LT,ave,5,IF,0,IF AREA:WW#0BFFF4: \
CDEF:A=ave \
VDEF:V=ave,AVERAGE \
LINE1:ave \
LINE1:A#000000:Disk_usage_% \
DEF:tmax=/opt/HBMonv2/sysinfo/hdd.rrd:hdd:MAX \
DEF:tmin=/opt/HBMonv2/sysinfo/hdd.rrd:hdd:MIN \
'GPRINT:ave:LAST:Last\: %2.1lf ' \
'GPRINT:tmin:MIN:Minimum\: %2.1lf ' \
'GPRINT:tmax:MAX:Maximum\: %2.1lf \j' >/dev/null

52
HBMonv2/sysinfo/rrd-db.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
# Db for temperature CPU
rrdtool create /opt/HBMonv2/sysinfo/tempC.rrd \
--step 300 \
DS:temp:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:MIN:0.5:1:288 \
RRA:MIN:0.5:3:672 \
RRA:MAX:0.5:1:288 \
RRA:MAX:0.5:3:672 \
RRA:LAST:0.5:1:288 \
RRA:LAST:0.5:3:672
# Db for memory usage
rrdtool create /opt/HBMonv2/sysinfo/mem.rrd \
--step 300 \
DS:mem:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:MIN:0.5:1:288 \
RRA:MIN:0.5:3:672 \
RRA:MAX:0.5:1:288 \
RRA:MAX:0.5:3:672 \
RRA:LAST:0.5:1:288 \
RRA:LAST:0.5:3:672
# Db for disk usage
rrdtool create /opt/HBMonv2/sysinfo/hdd.rrd \
--step 300 \
DS:hdd:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:MIN:0.5:1:288 \
RRA:MIN:0.5:3:672 \
RRA:MAX:0.5:1:288 \
RRA:MAX:0.5:3:672 \
RRA:LAST:0.5:1:288 \
RRA:LAST:0.5:3:672
# Db for CPU load
rrdtool create /opt/HBMonv2/sysinfo/load.rrd -s 60 \
DS:load1:GAUGE:180:0:U \
DS:load5:GAUGE:180:0:U \
DS:load15:GAUGE:180:0:U \
DS:cpuuser:COUNTER:180:0:100 \
DS:cpunice:COUNTER:180:0:100 \
DS:cpusystem:COUNTER:180:0:100 \
RRA:AVERAGE:0.5:1:1440 \
RRA:AVERAGE:0.5:1440:1 \
RRA:MIN:0.5:1440:1 \
RRA:MAX:0.5:1440:1

View File

@ -0,0 +1,3 @@
CRONDARGS=-s -m off
*/5 * * * * root /opt/HBMonv2/sysinfo/graph.sh
*/2 * * * * root /opt/HBMonv2/sysinfo/cpu.sh

View File

@ -0,0 +1,55 @@
<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">&nbsp;.: Bridge status :.&nbsp;</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>
</tr>
</table>
{% elif _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>BRIDGES display is disabled by setup</center></b></td>
</tr>
</table>
{% else %}
{% for _bridge, _bridge_data in _table['BRIDGES'].items() %}
<table style="width:100%; font: 10pt arial, sans-serif">
<colgroup>
<col style="width: 10%" />
<col style="width: 5%" />
<col style="width: 5%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 20%" />
<col style="width: 30%" />
</colgroup>
<h4 align="left">{{ _bridge }}</h4>
<tr style="width:100%; font: 10pt arial, sans-serif; background-color:#6A7D8E; color:white">
<th>System</th>
<th>Slot</th>
<th>TG#</th>
<th>Status</th>
<th>Timeout</th>
<th>Timeout Action</th>
<th>Connect TG#</th>
<th>Disconnect TG#</th>
</tr>
{% for system, _system_data in _table['BRIDGES'][_bridge].items() %}
<tr style="background-color:#f9f9f9f9;">
<td>{{ system }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['TS'] }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['TGID'] }}</td>
<td style="background-color:#{{ _table['BRIDGES'][_bridge][system]['BGCOLOR'] }}; color:#{{ _table['BRIDGES'][_bridge][system]['COLOR'] }}">{{ _table['BRIDGES'][_bridge][system]['ACTIVE'] }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['EXP_TIME'] }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['TO_ACTION'] }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['TRIG_ON'] }}</td>
<td>{{ _table['BRIDGES'][_bridge][system]['TRIG_OFF'] }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
{% endif %}
</fieldset>

View File

@ -0,0 +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">&nbsp;.: Lastheard :.&nbsp;</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>
</table></fieldset><br>

View File

@ -0,0 +1,118 @@
<fieldset style="width:900px;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">&nbsp;.: Server Activity :.&nbsp;</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>
</tr>
<tr style="border-collapse:collapse;border:none;">
<td id="lact">
<div id="rcorner"><div>
{% for _master in _table['MASTERS'] %}
{% for _client, _cdata in _table['MASTERS'][_master]['PEERS'].items() %}
{% if _cdata[1]['TS'] == True or _cdata[2]['TS'] == True %}
{% if _cdata[1]['TRX'] == "RX" %}
&#32;[<span style="color:#008000;">M</span>:&nbsp;<span style="color:#0065ff;">{{ _cdata[1]['CALL']|safe }}</span>
&nbsp;<font color=red>>></font>&nbsp;<span style="color:#b5651d;">{{ _cdata[1]['TG']|safe }}</span>]&nbsp;
{% endif %}
{% if _cdata[2]['TRX'] == "RX" %}
&#32;[<span style="color:#008000;">M</span>:&nbsp;<span style="color:#0065ff;">{{ _cdata[2]['CALL']|safe}}</span>
&nbsp;<font color=red>>></font>&nbsp;<span style="color:#b5651d;">{{_cdata[2]['TG']|safe}}</span>]&nbsp;
{% endif %}
{% 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>
</tr>
</table>
{% endif %}
{% for _peer, _pdata in _table['PEERS'].items() %}
{% if _pdata[1]['TS'] == True or _pdata[2]['TS'] == True %}
{% if _pdata[1]['TRX'] == "RX" %}
&#32;[<span style="color:#008000;">M</span>:&nbsp;<span style="color:#0065ff;">{{ _pdata[1]['CALL']|safe }}</span>
&nbsp;<font color=red>>></font>&nbsp;<span style="color:#b5651d;">{{ _pdata[1]['TG']|safe }}</span>]&nbsp;
{% endif %}
{% if _pdata[2]['TRX'] == "RX" %}
&#32;[<span style="color:#008000;">M</span>:&nbsp;<span style="color:#0065ff;">{{ _pdata[2]['CALL']|safe }}</span>
&nbsp;<font color=red>>></font>&nbsp;<span style="color:#b5651d;">{{ _pdata[2]['TG']|safe }}</span>]&nbsp;
{% endif %}
{% endif %}
{% endfor %}
{% if _table['OPENBRIDGES']|length >0 %}
{% 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' %}&#32;[<span style="color:#008000;">O</span>:&nbsp;<font color=#0065ff>{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1]}}</font>&nbsp;<font color=red>>></font>&nbsp;<font color=#b5651d>TG&nbsp;{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2]}}</font>]&nbsp;{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
</div></div></td>
</tr>
{% endif %}
</table>
</fieldset>
{% if _table['SETUP']['LASTHEARD'] == True %}
{% 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">&nbsp;.: Connected to Server :.&nbsp;</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%>
{% 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;">
<br>
<div style="text-align:left;"><span style="color:#464646;font-weight:600;line-height:1.4;">&nbsp;&nbsp;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;">
{% for _master in _table['MASTERS'] %}
{% 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>
<span class="tooltiptext" style="left:115%;top:-10px;">
<span style="font: 9pt arial,sans-serif;color:#FFFFFF">
&nbsp;&nbsp;&nbsp;<b>DMR ID</b>: <b><font color=yellow>{{ _client }}</b></font><br>
{% if _cdata['RX_FREQ'] == 'N/A' and _cdata['TX_FREQ'] == 'N/A' %}
&nbsp;&nbsp;&nbsp;<b>Type: <font color=yellow>IP Network</font></b><br>
{% else %}
&nbsp;&nbsp;&nbsp;<b>Type: <font color=yellow>Radio</font></b> ({{ _cdata['SLOTS'] }})<br>
{% endif %}
&nbsp;&nbsp;&nbsp;<b>Hardware</b>: {{_cdata['PACKAGE_ID'] }}
<br>&nbsp;&nbsp;&nbsp;<b>Soft_Ver</b>: {{_cdata['SOFTWARE_ID'] }}
<br>&nbsp;&nbsp;&nbsp;<b>Info</b>: {{_cdata['LOCATION']}}
<br>&nbsp;&nbsp;&nbsp;<b>Master</b>: <font color=yellow>{{_master}}</font>
</span></span></span>&nbsp;
{% endfor %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if _table['PEERS']|length >0 %}
<br>
<div style="text-align:left;"><span style="color:#464646;font-weight:600;line-height:1.8;">&nbsp;&nbsp;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>&nbsp;&nbsp;{{_peer}}&nbsp;&nbsp;</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>
</span>
{% else %}
<span class="tooltiptext" style="top:120%;left:50%;margin-left:-70%;width:100px;padding: 2px 0;">
<center><b><font color=white>Disconnected</font></center>
</span>
{% endif %}
</span>&nbsp;
{% endfor %}
</div>
{% endif %}
<br>
</div></td></tr></table>
</fieldset>

View File

@ -0,0 +1,55 @@
<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">&nbsp;.: Masters status :.&nbsp;</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;">
<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>
<th style='width: 40px;'>Slot</th>
<th style='width: 50%;'>Source</th>
<th style='width: 40%;'>Destination</th>
</tr>
{% for _master in _table['MASTERS'] %}
{% if ((_table['MASTERS'][_master]['PEERS']|length==0 or _table['MASTERS'][_master]['PEERS']|length>0) and emaster==True) or (_table['MASTERS'][_master]['PEERS']|length>0 and emaster==False) %}
<tr style="background-color:#f9f9f9f9;">
<td style="font-weight:bold" rowspan="{{ (_table['MASTERS'][_master]['PEERS']|length * 2) +1 }}"> {{_master}}<br><div style="font: 8pt arial, sans-serif">{{_table['MASTERS'][_master]['REPEAT']}}</div></td>
</tr>
{% for _client, _cdata in _table['MASTERS'][_master]['PEERS'].items() %}
<tr style="background-color:#f9f9f9f9;">
<td rowspan="2"><div class="tooltip"><b><font color=#0066ff>{{ _cdata['CALLSIGN']}}</font>
</b><span style="font: 8pt arial,sans-serif">(Id: {{ _client }})</span><span class="tooltiptext">
<span style="font: 9pt arial,sans-serif;color:#FFFFFF">
{% if _cdata['RX_FREQ'] == 'N/A' and _cdata['TX_FREQ'] == 'N/A' %}
&nbsp;&nbsp;&nbsp;<b>Type: <font color=yellow>IP Network</font></b><br>
{% else %}
&nbsp;&nbsp;&nbsp;<b>Type: <font color=yellow>Radio</font></b> ({{ _cdata['SLOTS'] }})<br>
{% endif %}
&nbsp;&nbsp;&nbsp;<b>Soft_Ver</b>: {{_cdata['SOFTWARE_ID'] }}
<br>&nbsp;&nbsp;&nbsp;<b>Hardware</b>: {{_cdata['PACKAGE_ID'] }}</span></span></div>
<br><div style="font: 92% arial,sans-serif; color:#b5651d;font-weight:bold">{{_cdata['LOCATION']}}</div></td>
<td style="background-color:#e8ffec;font: 10pt arial, sans-serif;" rowspan="2">{{ _cdata['CONNECTED'] }}</td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[1]['BGCOLOR'] if _cdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[1]['COLOR'] if _cdata[1]['COLOR']|length !=0 else '000000' }}"><span style="color:#{{ _cdata[1]['COLOR'] if _cdata[1]['BGCOLOR'] == 'ff6347' else 'b70101'}}">TS1</span></td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[1]['BGCOLOR'] if _cdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[1]['COLOR'] if _cdata[1]['COLOR']|length !=0 else '000000' }}">{{ _cdata[1]['SUB']|safe }}</td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[1]['BGCOLOR'] if _cdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[1]['COLOR'] if _cdata[1]['COLOR']|length !=0 else '000000' }}">{{ _cdata[1]['DEST']|safe }}</td>
<tr style="background-color:#f9f9f9f9;">
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[2]['BGCOLOR'] if _cdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[2]['COLOR'] if _cdata[2]['COLOR']|length !=0 else '000000' }}"><span style="color:#{{ _cdata[2]['COLOR'] if _cdata[2]['BGCOLOR'] == 'ff6347' else '3a4aa6'}}">TS2</span></td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[2]['BGCOLOR'] if _cdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[2]['COLOR'] if _cdata[2]['COLOR']|length !=0 else '000000' }}">{{ _cdata[2]['SUB']|safe }}</td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _cdata[2]['BGCOLOR'] if _cdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _cdata[2]['COLOR'] if _cdata[2]['COLOR']|length !=0 else '000000' }}">{{ _cdata[2]['DEST']|safe }}</td>
</tr>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</table>
{% 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>
</tr>
</table>
{% endif %}
</fieldset>

View File

@ -0,0 +1,25 @@
<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">&nbsp;.: OpenBridge status :.&nbsp;</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;">
<th style='width: 12%'>OpenBridge<br>Systems</th>
<th style='width: 12%'>Network ID</th>
<th style='width: 70%;'>Active QSOs</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&nbsp;{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>]&nbsp;{% 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>
</tr>
</table>
{% endif %}
</fieldset>

View File

@ -0,0 +1,37 @@
<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">&nbsp;.: Peers status :.&nbsp;</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;">
<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>
<th style='width: 42px;'>Slot</th>
<th style='width: 50%;'>Source</th>
<th style='width: 40%;'>Destination</th>
</tr>
{% for _peer, _pdata in _table['PEERS'].items() %}
<tr style="background-color:#f9f9f9f9;">
<td style="font-weight:bold" rowspan="2"> {{ _peer}}<br><span style="font-weight:normal; font: 7pt arial, sans-serif;">Mode: {{ _table['PEERS'][_peer]['MODE'] }}</span></td>
<td rowspan="2"><div class="tooltip"><b><font color=#0066ff>{{_table['PEERS'][_peer]['CALLSIGN']}}</font> </b><span style="font-weight:normal; font: 8pt arial, sans-serif;">(Id: {{ _table['PEERS'][_peer]['RADIO_ID'] }})</span><span class="tooltiptext" style="width:170px;">&nbsp;&nbsp;&nbsp;<b>Linked Time Slot: <font color=yellow>{{ _table['PEERS'][_peer]['SLOTS'] }}</font></b></span></div><br><div style="font: 92% arial, sans-serif; color:#b5651d;font-weight:bold">{{_table['PEERS'][_peer]['LOCATION']}}</div></td>
<td rowspan="2"; style="font: 9pt arial, sans-serif;{{ 'background-color:#98FB98' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else ';background-color:#ff704d' }}">{{ _table['PEERS'][_peer]['STATS']['CONNECTED'] }}<br><div style="font: 8pt arial, sans-serif">{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] - _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}</div></td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _pdata[1]['BGCOLOR'] if _pdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[1]['COLOR'] if _pdata[1]['COLOR']|length !=0 else '000000' }}"><span style="color:#b70101">TS1</span></td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _pdata[1]['BGCOLOR'] if _pdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[1]['COLOR'] if _pdata[1]['COLOR']|length !=0 else '000000' }}">{{ _pdata[1]['SUB']|safe }}</td>
<td style="font: 10pt arial, sans-serif;color:#464646;background-color:#{{ _pdata[1]['BGCOLOR'] if _pdata[1]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[1]['COLOR'] if _pdata[1]['COLOR']|length !=0 else '000000' }}">{{ _pdata[1]['DEST']|safe }}</td>
<tr style="background-color:#f9f9f9f9;">
<td style="font: 10pt arial, sans-serif;background-color:#{{ _pdata[2]['BGCOLOR'] if _pdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[2]['COLOR'] if _pdata[2]['COLOR']|length !=0 else '000000' }}"><span style="color:#{{ _pdata[2]['COLOR'] if _pdata[2]['BGCOLOR'] == 'ff6347' else '3a4aa6'}}">TS2</span></td>
<td style="font: 10pt arial, sans-serif;background-color:#{{ _pdata[2]['BGCOLOR'] if _pdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[2]['COLOR'] if _pdata[2]['COLOR']|length !=0 else '000000' }}">{{ _pdata[2]['SUB']|safe }}</td>
<td style="font: 10pt arial, sans-serif;color:#464646;background-color:#{{ _pdata[2]['BGCOLOR'] if _pdata[2]['BGCOLOR']|length !=0 else 'f9f9f9f9' }}; color:#{{ _pdata[2]['COLOR'] if _pdata[2]['COLOR']|length !=0 else '000000' }}">{{ _pdata[2]['DEST']|safe }}</td>
</tr>
</tr>
{% endfor %}
</table>
{% 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>
</tr>
</table>
{% endif %}
</fieldset>

21
HBMonv2/utils/Readme.md Normal file
View File

@ -0,0 +1,21 @@
Requirements a webserver with activated PHP (apache, nginx or whatever) PHP 7.x is ok
Extension of hbmonitor we log if a call is ended (I think its better as start) Please check permissions for wr
iting the logfile in target folder !
Call this script with crontab for everyday use.
Put this file in /etc/cron.daily/ and add attribute:
chmod +x /etc/cron.daily/lastheard
Call the website with http://YOUR_HOST/log.php it runs with a refresh/reload time of 30sec, change the script for
other timeset.
Thank you, Heiko DL1BZ, who shared the lastheard code.

View File

@ -0,0 +1,17 @@
[Unit]
Description=HBMonitor
# To make the network-online.target available
# systemctl enable systemd-networkd-wait-online.service
After=network-online.target syslog.target
Wants=network-online.target
[Service]
StandardOutput=null
WorkingDirectory=/opt/HBMonv2
RestartSec=3
ExecStart=/usr/bin/python3 /opt/HBMonv2/monitor.py
Restart=on-abort
[Install]
WantedBy=multi-user.target

8
HBMonv2/utils/lastheard Executable file
View File

@ -0,0 +1,8 @@
#!/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
/usr/bin/tail -250 /opt/HBMonv2/log/lastheard.log.save > /opt/HBMonv2/log/lastheard.log