HBmonitor/utils/Readme.md

57 lines
2.3 KiB
Markdown
Raw Normal View History

2019-06-26 14:00:59 -04:00
Requirements:
- a webserver with activated PHP (apache, nginx or whatever) PHP 7.x is ok
2019-06-29 15:25:19 -04:00
Modifikation/Extension of hbmonitor we log if a call is ended (I think its better as start) Please check permissions for writing the logfile in target folder !
2019-06-26 14:00:59 -04:00
if p[0] == 'GROUP VOICE' and p[2] != 'TX':
if p[1] == 'END':
log_message = '{}: {} {}: SYS: {:12.12s} SRC: {:8.8s}; {:15.15s} TS: {} TGID: {:>5s} SUB: {:8.8s}; {:30.30s} Time: {}s'.format(_now, p[0], p[1], p[3], p[5], alias_call(int(p[5]), peer_ids), p[7], p[8], p[6], alias_short
# 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 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]), peer_ids), p[7], p[8], p[6], alias_short(int(p[6]), subscriber_ids))
lh_logfile = open('/var/www/vhosts/dmr.bzsax.de/public_html/lastheard.log', "a")
lh_logfile.write(log_lh_message + '\n')
lh_logfile.close()
elif p[1] == 'START':
The line:
if int(float(p[9])) > 2:
we can skip show in last heard for exmaple from MASTER with name OPB-Link
if p[3] != 'OPB-Link' and int(float(p[9])) > 2:
2019-06-29 15:25:19 -04:00
I recommed to shorten the lastheard.log from time to time (I cut every day to 550 lines, longer values maybe extend the load time and parsing) with this script lastheard.sh:
2019-06-26 14:00:59 -04:00
2019-06-29 15:25:19 -04:00
#!/bin/bash
mv /var/www/html/lastheard.log /var/www/html/lastheard.log.save
/usr/bin/tail -550 /var/www/html/lastheard.log.save > /var/www/html/lastheard.log
mv /var/www/html/lastheard.log /var/www/html/lastheard.log.save
/usr/bin/tail -550 /var/www/html/lastheard.log.save > /var/www/html/lastheard.log
2019-06-26 14:00:59 -04:00
Call this script with crontab for everyday use.
Put this file in /etc/cron.d/daily
Call the website with http://[YOUR_HOST/log.php it runs with a refresh/reload time of 30sec, change the script for other timeset.
Heiko, DL1BZ
PS
Thank you, Heiko, who shared the lastheard code
The attached version of web_tables.py contains the display in the column of group names
73 Waldek SP2ONG