Compare commits

..

226 Commits

Author SHA1 Message Date
Waldek 55e1583b1c
changes posted by M0VUB 2022-03-13 17:03:20 +01:00
Waldek 2edee57a0a
changes posted by M0VUB 2022-03-13 17:00:40 +01:00
Waldek fdf340eb40
changes posted by M0VUB 2022-03-13 16:58:19 +01:00
Waldek 7a77f4a2c7
changes posted by M0VUB 2022-03-13 16:57:40 +01:00
Waldek 9a7e35e62c
changes posted by M0VUB 2022-03-13 16:57:04 +01:00
Waldek ebabc6efea
changes posted by M0VUB 2022-03-13 16:56:23 +01:00
Waldek 6e19c79a2d
changes posted by M0VUB 2022-03-13 16:55:39 +01:00
Waldek 45829ae800
changes posted by M0VUB 2022-03-13 16:54:56 +01:00
Waldek c50aede86e
changes posted by M0VUB 2022-03-13 16:53:21 +01:00
Waldek f4d81031f7
changes posted by M0VUB 2022-03-13 16:51:25 +01:00
Waldek bd8a80a938
changes posted by M0VUB 2022-03-13 16:46:32 +01:00
Waldek 3cdc4f1abb
logo posted by M0VUB 2022-03-13 16:41:55 +01:00
Waldek 67b33df40c
changes posted by M0VUB 2022-03-13 16:39:15 +01:00
Waldek 47e87b1236
use markupsafe v 2.0.1 2022-03-02 12:45:37 +01:00
Waldek 9ae9211390
Update index.php 2022-01-04 07:09:39 +01:00
Waldek 53c8eb1761
Update log.php 2022-01-04 07:09:16 +01:00
Waldek 4891011b82
Update bridges.php 2022-01-04 07:08:31 +01:00
Waldek 0e557f1657
Update info.php 2022-01-04 07:07:36 +01:00
Waldek f8a8aa481f
Update opb.php 2022-01-04 07:06:28 +01:00
Waldek a73663f1c1
Update moni.php 2022-01-04 07:06:15 +01:00
Waldek e177b1258d
Update peers.php 2022-01-04 07:05:55 +01:00
Waldek 4974946953
Update sysinfo.php 2022-01-04 07:05:35 +01:00
Waldek fc7dd12eff
Update masters.php 2022-01-04 07:05:16 +01:00
Waldek c44accb540
Update log.php 2022-01-04 07:04:53 +01:00
Waldek c7f6fcd96b
Update masters.php 2022-01-04 07:04:05 +01:00
Waldek 4d9c519c6a
Update moni.php 2022-01-04 07:03:33 +01:00
Waldek 23c6f52b7a
Update opb.php 2022-01-04 07:02:59 +01:00
Waldek 66df49cb79
Update peers.php 2022-01-04 07:02:26 +01:00
Waldek d46dfc31cc
Update sysinfo.php 2022-01-04 07:01:51 +01:00
Waldek 78a33d965c
Update index.php 2022-01-04 07:00:42 +01:00
Waldek 67a6a7c12d
added pass html code 2021-11-22 16:32:27 +01:00
Waldek 22f7d7a993
Update opb_table.html
added pass html code
2021-11-22 16:31:09 +01:00
Waldek e887ad389b
Update config.php 2021-10-14 16:34:47 +02:00
Waldek 2e1f038157
Update config.php 2021-10-14 12:09:33 +02:00
Waldek 86d1a69b00
small html update 2021-10-14 10:53:56 +02:00
Waldek ecc02320b2
small update 2021-10-13 08:50:03 +02:00
Waldek 80c8a3dd39
small update 2021-10-13 08:43:34 +02:00
Waldek 5764774781
Update README.md 2021-10-05 06:52:42 +02:00
Waldek a61ecc9394
Add files via upload 2021-09-01 12:51:14 +02:00
Waldek fe4239f417
Delete hbmon.png 2021-09-01 12:51:00 +02:00
Waldek 1ea4569a89
Add files via upload 2021-09-01 12:46:18 +02:00
Waldek f0d34191ad
Delete hbmon.png 2021-09-01 12:45:58 +02:00
Waldek d7adb9978e
Update styles.php 2021-08-28 20:13:23 +02:00
Waldek 33f2cdf909
Update README.md 2021-08-27 08:47:22 +02:00
Waldek 8722e7243d
example dashboard 2021-08-27 08:42:49 +02:00
Waldek f213f1f680
Update Readme.txt 2021-08-03 08:41:47 +02:00
Waldek d6d197e564
add example button to eSM 2021-08-03 08:38:10 +02:00
Waldek c4b53c2e22
Update Readme.txt 2021-08-02 20:14:38 +02:00
Waldek a62f7c532a
add info about crontab file 2021-08-02 20:14:01 +02:00
Waldek deed5ac0e5
Update local_talkgroup_ids.json 2021-07-19 16:52:34 +02:00
Waldek bd5b44e00c
update example of tgid 2021-07-19 16:46:27 +02:00
Waldek 89583d87b8
info update 2021-07-12 11:25:10 +02:00
Waldek cca779c363
html code update 2021-07-12 11:24:21 +02:00
Waldek 5233354d72
Update talkgroup_ids.json 2021-07-11 19:51:38 +02:00
Waldek 9d2c6a0207
Merge pull request #4 from w7ncx/main
Update README.md (#5)
2021-06-28 06:42:47 +02:00
w7ncx 7f1fdd4695
Update graph.sh
remove flag variable
check tempC directly to determine if it is set, and if so, use it
scale tempC properly for Pi output (RPi 4)
2021-06-27 21:10:06 -07:00
w7ncx f918ed31ae
Update Readme.txt
fix typos
change Pi temperature logic
2021-06-27 20:53:13 -07:00
w7ncx b8cb67d0dc
Update README.md (#5)
typos
2021-06-27 16:09:41 -07:00
Waldek 997894df1b
Merge pull request #3 from w7ncx/main
Fix spelling, add support for local_talkgroup_ids.json
2021-06-27 09:09:39 +02:00
w7ncx d00b029994
Update info.php (#1)
correct spelling
2021-06-26 20:13:15 -07:00
w7ncx 333e18ab87
Create local_talkgroup_ids.json (#4)
add support for local_talkgroup_ids.json
2021-06-26 20:12:50 -07:00
w7ncx 1ff373bb1c
Update monitor.py (#2)
added support for local_talkgroup_ids.json
2021-06-26 20:12:32 -07:00
w7ncx 5b678fa084
Update config_SAMPLE.py (#3)
* Update config_SAMPLE.py

added support for local_talkgroup_ids.json

* Update config_SAMPLE.py
2021-06-26 20:11:44 -07:00
Waldek ba79b1504f
fixed problem with non-UTF-8 chars in lastherad.log 2021-06-07 21:56:29 +02:00
Waldek 54135e9005
code format 2021-06-07 16:54:31 +02:00
Waldek 573685c53e
added missed code 2021-06-07 16:52:01 +02:00
Waldek 0a211cd934
Update README.md 2021-06-07 16:45:57 +02:00
Waldek cf9e9b792b
Update config_SAMPLE.py 2021-06-07 16:44:06 +02:00
Waldek 537ea68288
update info for OPB_FILTER 2021-06-07 16:35:47 +02:00
Waldek 4d66ffdb3d
set version 2021-06-07 16:33:12 +02:00
Waldek cf8265c171
Update README.md 2021-06-07 16:32:30 +02:00
Waldek b41df4398d
solved match START with END source
in lastherad for OBP link
2021-06-07 16:31:27 +02:00
Waldek 8d947ea057
Update config_SAMPLE.py 2021-06-04 20:13:06 +02:00
Waldek 37cc67ac94
Update README.md 2021-06-04 19:44:38 +02:00
Waldek 746d973962
Update Readme.txt 2021-06-03 20:16:40 +02:00
Waldek 5b4be4fb09
Update Readme.txt 2021-06-03 20:14:58 +02:00
Waldek d977af9026
Update README.md 2021-06-03 20:13:39 +02:00
Waldek 3660b2c546
add more info about eSM 2021-06-03 20:12:12 +02:00
Waldek 24c636568d
fixed center text in QSO active window 2021-06-03 16:03:34 +02:00
Waldek 7fcb6fe45f
Update config.php 2021-06-03 16:02:30 +02:00
Waldek 03b3ee1846
fixed center text in QSO active window 2021-06-03 16:01:39 +02:00
Waldek 11811577d5
Update styles.php 2021-06-03 12:44:53 +02:00
Waldek 8395a47f2a
set version 2021-06-03 10:26:17 +02:00
Waldek 8628d5aced
html code updated 2021-06-03 10:25:43 +02:00
Waldek 92095878de
update height active QSO window 2021-06-03 10:05:01 +02:00
Waldek 528300befa
fixed css for Chrome browser 2021-06-03 10:04:05 +02:00
Waldek 951ed80b4b
empty PNG file 2021-06-02 20:55:35 +02:00
Waldek 2f892e73a8
Delete tempC.png 2021-06-02 20:54:50 +02:00
Waldek a851e08fdf
set version 2021-06-02 20:46:27 +02:00
Waldek b26c9e05d9
update color of frame QSO active 2021-06-02 20:06:04 +02:00
Waldek 8dca33aea0
grap.sh script modified 2021-06-02 16:14:36 +02:00
Waldemar Ogonowski 3cd28744cf Make script executable. 2021-06-02 15:46:18 +02:00
Waldek 23aeb91026
fixed problem display Callsign 2021-06-02 15:32:14 +02:00
Waldek 5aa138b6a0
Update info.php 2021-06-02 13:54:26 +02:00
Waldek 6a0f9766d1
Update sysinfo.php 2021-06-02 13:54:08 +02:00
Waldek 52e24b9233
Update README.md 2021-06-01 13:37:58 +02:00
Waldek 31363ccabb
set version number 2021-05-30 18:59:44 +02:00
Waldek de50095b5c
added info about config.php height window activity 2021-05-30 18:58:54 +02:00
Waldek 0e3f576a2a
new version of widnow server activity 2021-05-30 18:55:59 +02:00
Waldek 34c58c4647
new version server activity window 2021-05-30 18:48:03 +02:00
Waldek f5b031400d
Delete main_table.html 2021-05-30 18:46:54 +02:00
Waldek 5c01cfbf52
added TG string 2021-05-30 18:46:36 +02:00
Waldek 8260774c79
added height definition for activity window 2021-05-30 18:43:56 +02:00
Waldek cad69c454e
added styles for window activity 2021-05-30 18:41:57 +02:00
Waldek a7a1d6460a
Update Readme.txt 2021-05-26 07:08:17 +02:00
Waldek 7e144d2897
Update log.php 2021-05-25 19:52:07 +02:00
Waldek 48c0a481ba
Update log.php 2021-05-25 19:50:02 +02:00
Waldek 01f70f973a
Update log.php 2021-05-25 19:48:52 +02:00
Waldek e64bd122a1
Update README.md 2021-05-25 07:09:20 +02:00
Waldek cc38bb708d
Update Readme.txt 2021-05-25 07:06:42 +02:00
Waldek 31fecc7df1
Update README.md 2021-05-25 06:58:49 +02:00
Waldek 9bf4eadeb8
removed RX info in OBP on main page 2021-05-24 20:50:43 +02:00
Waldek f72ea6d4af
Update log.php 2021-05-24 18:06:23 +02:00
Waldek f30494b355
Update log.php 2021-05-24 18:02:23 +02:00
Waldek 53b26925f9
Update styles.php 2021-05-24 17:50:32 +02:00
Waldek 27fb569aec
Update styles.php 2021-05-24 10:01:19 +02:00
Waldek d1112f0c35
small html code update 2021-05-24 09:43:13 +02:00
Waldek 993b6e1f5f
small html code update 2021-05-24 09:41:59 +02:00
Waldek 2a44420fcf
small html code update 2021-05-24 07:12:47 +02:00
Waldek 372227ee9c
small html code update 2021-05-24 07:02:36 +02:00
Waldek 732153d21c
small html update 2021-05-23 20:30:34 +02:00
Waldek a2bd575fbb
small html update 2021-05-23 19:35:09 +02:00
Waldek f0b2797e94
Update log.php 2021-05-23 19:34:45 +02:00
Waldek c2354ad7d2
log.php with external css 2021-05-23 19:28:39 +02:00
Waldek ea3f30b445
Delete log.php 2021-05-23 19:28:11 +02:00
Waldek d7b84b43a9
add css for log.php file 2021-05-23 19:25:39 +02:00
Waldek adf7da9e48
remove TimeSlot info 2021-05-22 12:13:27 +02:00
Waldek 479c2088f1
Update lastheard.html 2021-05-22 12:11:48 +02:00
Waldek d532524dcb
remove TimeSlot info from lasheard 2021-05-22 12:08:00 +02:00
Waldek 3885cb44d1
remove TimeSlot info 2021-05-22 12:02:38 +02:00
Catalin Vatra aa8472994d Revert "SSL and nonSSL at the same time."
This reverts commit 15a966ad5e.
2021-05-21 14:05:13 +03:00
Catalin Vatra 15a966ad5e SSL and nonSSL at the same time.
Add the possibility of using SSL and non-SSL connections to HBMon.

Please adjust the network ports (according to your needs) both in monitor.py and hbmon.js
2021-05-21 13:54:44 +03:00
Waldek 9922d3dd74
small update 2021-05-21 10:15:30 +02:00
Waldek 7e5b6c943c
Update hbmon.js 2021-05-21 09:57:40 +02:00
Waldek f457ebd299
Update README.md 2021-05-21 07:02:20 +02:00
Waldek d8f0c3e027
Update README.md 2021-05-21 07:01:58 +02:00
Waldek 0bc4197c03
Update README.md 2021-05-21 06:55:42 +02:00
Waldek bffd3a5f8d
Update README.md 2021-05-20 09:35:15 +02:00
Waldek 4f9b893000
Update README.md 2021-05-20 09:33:44 +02:00
Waldek cc53dda1e2
add comments 2021-05-20 09:31:16 +02:00
Waldek cc7f3c279f
Update README.md 2021-05-19 07:14:31 +02:00
Waldek fb549fdb59
Update README.md 2021-05-19 07:08:11 +02:00
Catalin Vatra a84418e789 Update variable extraction and minor adjustments
1. Extract URL parameter for later use
2. Extract DESCRIPTION parameter for later use
3. Adjustments for RX_FREQ and TX_FREQ for systems with only one leading zero in frequency field
2021-05-18 19:43:08 +03:00
Waldek b41eb4787d
Add files via upload 2021-05-18 17:37:04 +02:00
Waldek 64b10381e0
Add files via upload 2021-05-18 17:33:56 +02:00
Waldek 7424b69665
Create index.html 2021-05-18 17:33:24 +02:00
Waldek 5f10729d8e
Add files via upload 2021-05-18 17:32:43 +02:00
Waldek 3af2acdab5
Add files via upload 2021-05-18 17:32:24 +02:00
Waldek bc7000f245
Add files via upload 2021-05-18 17:32:01 +02:00
Waldek 27349fe775
Add files via upload 2021-05-18 17:31:37 +02:00
Waldek a604ec65ae
Add files via upload 2021-05-18 17:31:15 +02:00
Waldek 6bd6cc296d
Add files via upload 2021-05-18 17:30:57 +02:00
Waldek 7653a5022f
Add files via upload 2021-05-18 17:30:39 +02:00
Waldek c61ab28203
Add files via upload 2021-05-18 17:30:19 +02:00
Waldek 0630602e3c
Add files via upload 2021-05-18 17:29:41 +02:00
Waldek 489e2db7af
Add files via upload 2021-05-18 17:29:22 +02:00
Waldek 56d29a042c
Create index.html 2021-05-18 17:29:07 +02:00
Waldek 196182f25a
Create index.html 2021-05-18 17:28:44 +02:00
Waldek e27ca08fd3
Create index.html 2021-05-18 17:28:18 +02:00
Waldek d2f2494100
Add files via upload 2021-05-18 17:27:44 +02:00
Waldek 76c2d5e0e6
Add files via upload 2021-05-18 17:27:29 +02:00
Waldek 80eb09befb
Add files via upload 2021-05-18 17:27:11 +02:00
Waldek f5497a97d4
Add files via upload 2021-05-18 17:26:55 +02:00
Waldek cfca0ca9ce
Add files via upload 2021-05-18 17:26:37 +02:00
Waldek 585dfb07d1
Add files via upload 2021-05-18 17:26:22 +02:00
Waldek 6d2be47b87
Add files via upload 2021-05-18 17:26:09 +02:00
Waldek 0a935d4365
Add files via upload 2021-05-18 17:25:53 +02:00
Waldek d2a6f3847e
Add files via upload 2021-05-18 17:25:35 +02:00
Waldek 0c0fa82ad9
Add files via upload 2021-05-18 17:25:16 +02:00
Waldek ecbdaa3f5f
Create index.html 2021-05-18 17:24:53 +02:00
Waldek 95bb620f34
Add files via upload 2021-05-18 17:23:35 +02:00
Waldek 45a94c0d17
Add files via upload 2021-05-18 17:23:15 +02:00
Waldek f24184b085
Delete graph.sh 2021-05-18 17:22:57 +02:00
Waldek ce20c2f721
Delete cpu.sh 2021-05-18 17:22:51 +02:00
Waldek c177142c17
Update Readme.txt 2021-05-18 17:22:40 +02:00
Waldek ec4c328f74
Add files via upload 2021-05-18 17:21:23 +02:00
Waldek 0d5a4a7045
Delete lastheard.html 2021-05-18 17:20:48 +02:00
Waldek 192d36f7d1
Add files via upload 2021-05-18 17:20:26 +02:00
Waldek 9a633bcc7d
Add files via upload 2021-05-18 17:19:45 +02:00
Waldek 819492791f
Add files via upload 2021-05-18 17:19:15 +02:00
Waldek dbee4ded6e
Add files via upload 2021-05-18 17:18:54 +02:00
Waldek 2f9a745c31
Add files via upload 2021-05-18 17:18:40 +02:00
Waldek b180cc7ad8
Delete buttons.html 2021-05-18 17:18:24 +02:00
Waldek 4236331f06
Delete info_template.html 2021-05-18 17:18:19 +02:00
Waldek 324d09d09b
Delete peers_table.html 2021-05-18 17:18:13 +02:00
Waldek 09488e37d7
Delete peers_template.html 2021-05-18 17:18:08 +02:00
Waldek 4d59b48d4b
Delete sysinfo_table.html 2021-05-18 17:18:03 +02:00
Waldek 55e684869a
Delete sysinfo_template.html 2021-05-18 17:17:58 +02:00
Waldek 10a35e0f27
Delete moni_table.html 2021-05-18 17:17:53 +02:00
Waldek efd1cc2196
Delete opb_table.html 2021-05-18 17:17:48 +02:00
Waldek 6746b7b6d9
Delete opb_template.html 2021-05-18 17:17:43 +02:00
Waldek 8cf40c8b63
Delete masters_template.html 2021-05-18 17:17:37 +02:00
Waldek ba0640e257
Delete moni_template.html 2021-05-18 17:17:32 +02:00
Waldek 0d9e699323
Delete main_table.html 2021-05-18 17:17:26 +02:00
Waldek 32a1b59b29
Delete masters_table.html 2021-05-18 17:17:09 +02:00
Waldek 570b017a89
Delete info_table.html 2021-05-18 17:17:04 +02:00
Waldek fe40d985ff
Delete index_template.html 2021-05-18 17:16:59 +02:00
Waldek b0754c4516
Delete bridges_template.html 2021-05-18 17:16:53 +02:00
Waldek 41d0b32c6d
Delete bridge_table.html 2021-05-18 17:16:45 +02:00
Waldek 0ca979932d
version with external webserver 2021-05-18 17:16:33 +02:00
Waldek e70bb40165
update 2021-05-18 17:15:53 +02:00
Waldek c6621b3b35
replace by version external webserver 2021-05-18 17:14:22 +02:00
Waldek 206449c291
update 2021-05-18 17:13:42 +02:00
Waldek 8054d98161
Update lastheard 2021-05-18 17:12:40 +02:00
Waldek c6bd37bbf1
Delete log.php 2021-05-18 17:12:03 +02:00
Waldek 075a10f263
Delete index.html 2021-05-18 17:11:51 +02:00
Waldek 205d7740b4
Delete hbmon.js 2021-05-18 17:11:45 +02:00
Waldek bc441f3862
Delete tempC.png 2021-05-18 17:11:34 +02:00
Waldek 158f8bde4b
Delete mem.png 2021-05-18 17:11:29 +02:00
Waldek 69042de60b
Delete logo.png 2021-05-18 17:11:24 +02:00
Waldek 8544aa1ff0
Delete index.html 2021-05-18 17:11:17 +02:00
Waldek 6a230a0153
Delete hdd.png 2021-05-18 17:11:10 +02:00
Waldek 49b5c273e5
Delete hblink_powered.png 2021-05-18 17:11:04 +02:00
Waldek d09ae4d500
Delete cpu.png 2021-05-18 17:10:56 +02:00
Waldek 6851e90c9d
Delete HBlink.svg 2021-05-18 17:10:51 +02:00
Waldek 2bfa331df4
Delete HBlink.png 2021-05-18 17:10:45 +02:00
Waldek e4a2648fb8
Delete localhost_2-day.png 2021-05-18 17:10:39 +02:00
Waldek 26e844f2a8
Delete index.html 2021-05-18 17:10:32 +02:00
Waldek b0db027170
Delete styles.css 2021-05-18 17:10:13 +02:00
Waldek 8db02e9287
Delete index.html 2021-05-18 17:10:05 +02:00
Waldek 5e4e928f20
Delete talkgroup_ids_freedmr.json 2021-05-16 18:16:43 +02:00
Waldek da2c8d90d5
Delete talkgroup_ids_bm.json 2021-05-16 18:16:35 +02:00
Waldek d497b138bd
Add files via upload 2021-05-16 18:10:47 +02:00
Waldek e0ce4c1de7
Delete talkgroup_ids_freedmr.json 2021-05-16 18:10:19 +02:00
Waldek cc36abb319
update requested jinja2 version 2021-05-16 11:44:08 +02:00
Waldek 55dac54f9b
select jinja2 v2.11.2 which works 2021-05-16 11:36:45 +02:00
62 changed files with 968 additions and 861 deletions

134
README.md
View File

@ -1,18 +1,83 @@
**HBmonitor is a "web dashboard" for HBlink by N0MJS.**
***This is version of HBMonitor V2 by SP2ONG 2019-2021***
***This is version of HBMonitor V2 by SP2ONG 2019-2022***
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
HBmonitor tested on Debian v9,v10,v11
This is version HBMonitor V2
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
@ -25,46 +90,23 @@ This is version HBMonitor V2
systemctl enable hbmon
systemctl start hbmon
systemctl status hbmon
forward TCP ports 8080 and 9000 in firewall
forward TCP port 9000 and web server port 8080 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:
*****************************************************************************************
---
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.
After update distribution of Linux jinja2 to version 3.x you can find problem with run HBMonitor with error:
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.
ValueError: The 'monitor' package was not installed in a way that PackageLoader understands.
If not need monitor online rules (I do not recommend please use in config.py BRIDGES_INC = False
You must uninstall jinja2 and reinstalling with this version Jinja2==2.11.3
pip3 uninstall jinja2
and
pip3 install Jinja2==2.11.3
---
@ -76,12 +118,16 @@ 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">

View File

@ -1,5 +1,3 @@
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
@ -9,44 +7,13 @@ 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
# 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"
# 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 = ""
# 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
@ -54,7 +21,8 @@ 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)
FILE_RELOAD = 30 # Number of days before we reload DMR-MARC database files
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'

35
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 &copy; 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 &copy; 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>

60
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

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

View File

@ -1,4 +1,78 @@
<?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;
@ -108,5 +182,3 @@ 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;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
html/img/HBLINK_logoV2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
html/img/HBLINK_logoV2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
html/img/cpu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
html/img/hbmon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

BIN
html/img/hdd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

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

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

BIN
html/img/mem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 563 B

41
html/include/config.php Normal file
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

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

45
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 &copy; 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">&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 &copy; 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>

View File

@ -1,35 +1,32 @@
<!DOCTYPE html>
<html>
<?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.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)" />
<link rel="stylesheet" type="text/css" href="css/styles.php" />
<meta name="description" content="Copyright &copy; 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:1250px; text-align: center; margin-top:5px;">
<img alt="" src="/img/logo.png" />
<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;"><<<system_name>>></span></p>
<p style="text-align:center;"><span style="color:#000;font-size: 18px; font-weight:bold;"><?php echo REPORT_NAME;?></span></p>
<p></p>
</div>
<div style="width: 1100px;">
<noscript>You must enable JavaScript</noscript>
<p id="info"></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 style=" height: 32px;font: 10pt arial, sans-serif;border:0;<<<theme_color>>>">
<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>
@ -49,13 +46,13 @@
</tr>
</table>
<br>
<span style="text-align: center;">Hotspot: D - duplex | S - smiplex</span>
<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>
Copyright &copy; 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-2021 (v2021) -->
<!-- This is version of HBMonitor SP2ONG 2019-2022 -->
</p>
</center>
</body>

119
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 &copy; 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>&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 &copy; 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">&copy; developed by DL1BZ as logging-extension of HBmonitor (2018,2019)</font><br>
</p>
</div>
</center>
</body>
</html>

35
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 &copy; 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 &copy; 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>

42
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 &copy; 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">&nbsp;.: Call log :.&nbsp;</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 &copy; 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 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 &copy; 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 &copy; 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/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 &copy; 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 &copy; 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>

View File

@ -7,16 +7,12 @@
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 = "ws://" + window.location.hostname + ":9000";
wsuri = (((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.hostname + ":9000");
if ("WebSocket" in window) {
sock = new WebSocket(wsuri);
@ -37,13 +33,10 @@
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);
@ -54,29 +47,20 @@
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);
}
@ -87,11 +71,8 @@
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';

4
html/scripts/index.html Normal file
View File

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

55
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 &copy; 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">&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 &copy; 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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

14
local_talkgroup_ids.json Normal file
View File

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

View File

@ -41,10 +41,6 @@ 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
@ -104,12 +100,13 @@ 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:
@ -313,7 +310,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['RX_FREQ'][:3] == b'000':
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':
_ctable_peer['TX_FREQ'] = 'N/A'
_ctable_peer['RX_FREQ'] = 'N/A'
else:
@ -350,6 +347,16 @@ 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:
@ -399,7 +406,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)
# Proccess Peer Systems
# Process 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']
@ -408,6 +415,16 @@ 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()
@ -582,26 +599,20 @@ def build_bridge_table(_bridges):
build_time = time()
def build_stats():
global build_time, URL_PATH
global build_time
now = time()
if True: #now > build_time + 1:
if CONFIG:
main = 'i' + itemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
main = 'i' + itemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
dashboard_server.broadcast(main)
peers = 'p' + ptemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
peers = 'p' + ptemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
dashboard_server.broadcast(peers)
masters = 'c' + ctemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH,emaster=EMPTY_MASTERS)
masters = 'c' + ctemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'],emaster=EMPTY_MASTERS)
dashboard_server.broadcast(masters)
opb = 'o'+ otemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
opb = 'o'+ otemplate.render(_table=CTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
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'],auth=WEB_AUTH)
bridges = 'b' + btemplate.render(_table=BTABLE,dbridges=BTABLE['SETUP']['BRIDGES'])
dashboard_server.broadcast(bridges)
build_time = now
@ -650,8 +661,10 @@ 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 {}&nbsp;&nbsp;&nbsp;&nbsp;{}'.format(destination,alias_tgid(destination,talkgroup_ids))
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TG'] = 'TG&nbsp;{}'.format(destination)
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TRX'] = crxstatus
if action == 'END':
CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TS'] = False
@ -659,13 +672,15 @@ 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),'TG {}'.format(destination),timeout)
CTABLE['OPENBRIDGES'][system]['STREAMS'][streamId] = (trx, alias_call(sourceSub, subscriber_ids),'{}'.format(destination),timeout)
if action == 'END':
if streamId in CTABLE['OPENBRIDGES'][system]['STREAMS']:
del CTABLE['OPENBRIDGES'][system]['STREAMS'][streamId]
@ -687,8 +702,10 @@ 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 {}&nbsp;&nbsp;&nbsp;&nbsp;{}'.format(destination,alias_tgid(destination,talkgroup_ids))
CTABLE['PEERS'][system][timeSlot]['TG'] = 'TG&nbsp;{}'.format(destination)
CTABLE['PEERS'][system][timeSlot]['TRX'] = prxstatus
if action == 'END':
CTABLE['PEERS'][system][timeSlot]['TS'] = False
@ -696,8 +713,10 @@ 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()
@ -740,23 +759,32 @@ 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:
if int(float(p[9]))> 2:
# 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:
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")
lh_logfile = open(LOG_PATH+"lastheard.log", "a", encoding="UTF-8", errors="ignore")
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")
f = open(PATH+"templates/lastheard.html", "w", encoding="UTF-8", errors="ignore")
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\">&nbsp;.: Lastheard :.&nbsp;</font></b></legend>\n")
f.write("<table style=\"width:100%; font: 10pt arial, sans-serif;background-color:#f1f1f1;\">\n")
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:
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:
for row in islice(reversed(list(csv.reader(textfile))),200):
duration=row[1]
dur=str(int(float(duration.strip())))
@ -774,13 +802,31 @@ 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
# 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]
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:
@ -853,7 +899,7 @@ class reportClientFactory(ReconnectingClientFactory):
#
class dashboard(WebSocketServerProtocol):
global URL_PATH, INFO, MONITOR, OPENBRIDGE
global INFO, MONITOR, OPENBRIDGE
def onConnect(self, request):
logging.info('Client connecting: %s', request.peer)
@ -865,14 +911,11 @@ 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,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'))
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'))
for _message in LOGBUF:
if _message:
_bmessage = ('l' + _message).encode('utf-8')
@ -915,104 +958,6 @@ 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(
@ -1063,6 +1008,11 @@ 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')
@ -1080,45 +1030,6 @@ 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)
@ -1131,21 +1042,24 @@ if __name__ == '__main__':
# Connect to HBlink
reactor.connectTCP(HBLINK_IP, HBLINK_PORT, reportClientFactory())
# Create websocket server to push content to clients
# 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 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()

View File

@ -1,4 +1,57 @@
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:
@ -7,7 +60,7 @@ Install package:
Change scripts to execute:
chmod +x /opt/HBMonv2/sysinfo/cpu.sh
chmod +x /opt/HBMonv2/sysinfo/grap.sh
chmod +x /opt/HBMonv2/sysinfo/graph.sh
chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh
Run script create database
@ -15,21 +68,32 @@ 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 not avilable set:
tempcpu=false
For VPS set:
tempcpu=false
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
===============================
@ -59,11 +123,16 @@ 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 to:
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:/opt/HBMonv2/img/mrtg
WorkDir:/var/www/html/hbmon/img/mrtg
or
WorkDir:/var/www/html/img/mrtg
put below lines in section your netrwork card
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
@ -72,8 +141,6 @@ 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 /opt/HBMonv2/templates/sysinfo_template.html
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 /var/www/html/sysinfo.php
and check / verify name of img from mrtg: <img alt="" src="img/mrtg/localhost_2-day.png" />

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Get values
# 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/"`
@ -17,7 +17,7 @@ NOW=`date -u +%s`
# CPU loads
/usr/bin/rrdtool graph /opt/HBMonv2/img/cpu.png \
/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 \

View File

@ -1,35 +1,30 @@
#!/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:
# 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
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 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
# 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
#=====================================
@ -47,7 +42,7 @@ NOW=`date -u +%s`
# Update db =====================================================
if $tempcpu == "True" ; then
if [ -n "$tempC" ] ; then
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/tempC.rrd $NOW:$tempC
fi
@ -58,9 +53,9 @@ fi
# Generate images ================================================================
if $tempcpu == "True" ; then
if [ -n "$tempC" ] ; then
# Temperature CPU
/usr/bin/rrdtool graph /opt/HBMonv2/img/tempC.png -t "Temperature CPU 24H - `/bin/date`" \
/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 \
@ -97,7 +92,7 @@ DEF:tmin=/opt/HBMonv2/sysinfo/tempC.rrd:temp:MIN \
fi
# Memory usage
/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`" \
/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 \
@ -133,7 +128,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 /opt/HBMonv2/img/hdd.png -t "Disk usage 24H - Size: `df -h / |awk 'NR==2 { print $2 }'` - `/bin/date`" \
/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 \

View File

@ -1,10 +1,14 @@
{
"results": [
{
"tgid": 7,
"callsign": "TG Local",
"id": "7"
},
{
"tgid": 9,
"callsign": "TG Local",
"country": "",
"callsign": "TG XLX",
"id": "9"
}
]
}
}

View File

@ -1,10 +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">&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 HBLink server ...</center></b></td>
<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 %}

View File

@ -1,35 +0,0 @@
<!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>

View File

@ -1,66 +0,0 @@
<div style="width: 1100px;">
<!-- HBMonitor buttons HTML code -->
<a href="/"><button class="button link">&nbsp;Home&nbsp;</button></a>
{% if auth == True %}
&nbsp;
<div class="dropdown">
<button class="dropbtn">&nbsp;Admin Area&nbsp;</button>
<div class="dropdown-content">
<a href="/masters">&nbsp;Masters&nbsp;</a>
<a href="/peers">&nbsp;Peers&nbsp;</a>
<a href="/opb">&nbsp;OpenBridge&nbsp;</a>
{% if dbridges == True %}
<a href="/bridges">&nbsp;Bridges&nbsp;</a>
{% endif %}
<a href="/moni">&nbsp;Monitor&nbsp;</a>
<a href="/sinfo">&nbsp;System Info&nbsp;</a>
</div>
</div>
{% else %}
&nbsp;
<a href="/masters"><button class="button link">&nbsp;Masters&nbsp;</button></a>
&nbsp;
<a href="/peers"><button class="button link">&nbsp;Peers&nbsp;</button></a>
&nbsp;
<a href="/opb"><button class="button link">&nbsp;OpenBridge&nbsp;</button></a>
{% if dbridges == True %}
&nbsp;
<a href="/bridges"><button class="button link">&nbsp;Bridges&nbsp;</button></a>
{% endif %}
&nbsp;
<a href="/moni"><button class="button link">&nbsp;Monitor&nbsp;</button></a>
&nbsp;
<a href="/sinfo"><button class="button link">&nbsp;System Info&nbsp;</button></a>
&nbsp;
{% endif %}
<a href="/info"><button class="button link">&nbsp;Info&nbsp;</button></a>
&nbsp;
<!-- Own buttons HTML code -->
<!-- link to long lastheard
<a target='_blank' href="http://192.168.1.1/log.php"><button class="button link">&nbsp;Lastheard&nbsp;</button></a>
&nbsp;
-->
<!-- 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>
&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

@ -1,44 +0,0 @@
<!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">&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 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>

View File

@ -1 +0,0 @@
{% include 'buttons.html' ignore missing %}

View File

@ -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">&nbsp;.: Lastheard :.&nbsp;</font></b></legend>
<table style="width:100%; font: 10pt arial, sans-serif">
<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>
<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

@ -1,77 +1,61 @@
{% 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">&nbsp;.: DMR Server activity :.&nbsp;</font></b></legend>
<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">&nbsp;.: Server Activity :.&nbsp;</font></b></legend>
{% if _table['MASTERS']|length >0 %}
<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>
<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>
{% for _master in _table['MASTERS'] %}
<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 %}
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
{% if _cdata[1]['TRX'] == "RX" %}
<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>
&#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" %}
<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>
&#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 %}
</tr>
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
<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>
<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 %}
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
{% if _pdata[1]['TRX'] == "RX" %}
<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>
&#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" %}
<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>
&#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 %}
</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 %}
<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>]&nbsp; {% endfor %}
</td>
</tr>
{% 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]|safe}}</font>]&nbsp;{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
</div></div></td>
</tr>
{% endif %}
</table>
</fieldset>
@ -79,10 +63,11 @@
{% 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 DMR 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;" width=100%>
<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="background-color:#f9f9f9f9;"><td>
<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;">
@ -90,7 +75,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;" 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;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>
@ -102,7 +87,8 @@
&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>
<br>&nbsp;&nbsp;&nbsp;<b>Master</b>: <font color=yellow>{{_master}}</font>
<br>&nbsp;&nbsp;&nbsp;<b>Time connected</b>: <font color=yellow>{{ _cdata['CONNECTED'] }}</font>
</span></span></span>&nbsp;
{% endfor %}
{% endif %}
@ -114,7 +100,7 @@
<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="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>&nbsp;&nbsp;{{_peer}}&nbsp;&nbsp;</b>
<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>
@ -129,5 +115,5 @@
</div>
{% endif %}
<br>
</td></tr></table>
</div></td></tr></table>
</fieldset>

View File

@ -1,9 +1,8 @@
{% 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">&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 style="font: 10pt arial, sans-serif;{{ themec }}">
<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>
@ -49,7 +48,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 DMR server ...</center></b></td>
<td style='border:none;height:60px;'><font color=brown><b><center>Waiting for data from the Server ...</center></b></td>
</tr>
</table>
{% endif %}

View File

@ -1,34 +0,0 @@
<!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>

View File

@ -1 +0,0 @@
{% include 'buttons.html' ignore missing %}

View File

@ -1,41 +0,0 @@
<!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">&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>

View File

@ -1,25 +1,24 @@
{% 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">&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 style="width:100%; font: 10pt arial, sans-serif;{{ themec }}">
<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 Calls</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> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>]&nbsp;{% 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>TG&nbsp;{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2]|safe }}</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 the DMR server ... or not defined on DMR server</center></b></td>
<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 %}

View File

@ -1,34 +0,0 @@
<!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>

View File

@ -1,9 +1,8 @@
{% 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">&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 style="font: 10pt arial, sans-serif;{{ themec }}">
<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>
@ -31,7 +30,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 DMR server ... or not defined on DMR server</center></b></td>
<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 %}

View File

@ -1,34 +0,0 @@
<!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>

View File

@ -1,2 +0,0 @@
{% include 'buttons.html' ignore missing %}

View File

@ -1,53 +0,0 @@
<!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">&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>

View File

@ -1,4 +1,7 @@
#!/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

View File

@ -1,97 +0,0 @@
<?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\">&copy; 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>&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>&nbsp;Slot&nbsp;<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","&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>".$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.TRIM($user_name[$i]).$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."<center>&nbsp;".$ts[$i]."&nbsp;</center>".$s.$system[$i]."</TR>\n";
}
echo "\n</table></fieldset></div></body></html>";
// close logfile after parsing
fclose ($handle);
?>