D-Star - linking is coming from Links.log now, LH-list now shows network watchdog-lines also with duration, loss and ber
This commit is contained in:
parent
762cc24c78
commit
5be21a6df2
4 changed files with 124 additions and 7 deletions
|
@ -1,9 +1,75 @@
|
||||||
<?php
|
<?php
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
define("REPEATERCALLSIGN","DG9VH");
|
define("REPEATERCALLSIGN","DG9VH");
|
||||||
define("LOGPATH","/mnt/ramdisk/");
|
define("MMDVMLOGPATH","/mnt/ramdisk/"); // hint: add trailing / !!!
|
||||||
define("LOGPREFIX","MMDVM");
|
define("MMDVMLOGPREFIX","MMDVM");
|
||||||
define("LOGFILE",LOGPATH . LOGPREFIX . "-" . date("Y-m-d") . ".log");
|
define("MMDVMLOGFILE",MMDVMLOGPATH . MMDVMLOGPREFIX . "-" . date("Y-m-d") . ".log");
|
||||||
|
|
||||||
|
// enter exact path to your log files.
|
||||||
|
// If your Linux is a MARYLAND-DSTAR-Image, this paths would work.
|
||||||
|
|
||||||
|
// Adjust to suit, uncomment correct line, if no line is uncommented, customize
|
||||||
|
// else-path to suitable paths.
|
||||||
|
|
||||||
|
define("DISTRIBUTION","MARYLAND");
|
||||||
|
//define("DISTRIBUTION","WESTERN");
|
||||||
|
//define("DISTRIBUTION","DL5DI_DEBIAN");
|
||||||
|
//define("DISTRIBUTION","DL5DI_CENTOS");
|
||||||
|
//define("DISTRIBUTION","OTHER");
|
||||||
|
|
||||||
|
switch (DISTRIBUTION) {
|
||||||
|
case "MARYLAND":
|
||||||
|
// Configuration for Maryland-Dstar-Image
|
||||||
|
define("LOGPATH", "/var/log");
|
||||||
|
define("CONFIGPATH", "/etc/gateway");
|
||||||
|
define("DSTARREPEATERLOGPATH", LOGPATH. "/dstarrepeater_1");
|
||||||
|
define("DSTARREPEATERLOGFILENAME", "DStarRepeater_Repeater-1-");
|
||||||
|
define("LINKLOGPATH", LOGPATH . "/gateway/Links.log");
|
||||||
|
define("HRDLOGPATH", LOGPATH . "/gateway/Headers.log");
|
||||||
|
break;
|
||||||
|
case "WESTERN":
|
||||||
|
// Configuration for Western-Dstar-Image
|
||||||
|
define("LOGPATH", "/var/log");
|
||||||
|
define("CONFIGPATH", "/etc");
|
||||||
|
define("DSTARREPEATERLOGPATH", LOGPATH. "/");
|
||||||
|
define("DSTARREPEATERLOGFILENAME", "DStarRepeater-");
|
||||||
|
define("LINKLOGPATH", LOGPATH . "/Links.log");
|
||||||
|
define("HRDLOGPATH", LOGPATH . "/Headers.log");
|
||||||
|
break;
|
||||||
|
case "DL5DI_CENTOS":
|
||||||
|
// Configuration for DL5DI-Installation-packages on CENTOS
|
||||||
|
define("LOGPATH", "/var/log/dstar");
|
||||||
|
define("CONFIGPATH", "/etc");
|
||||||
|
define("DSTARREPEATERLOGPATH", LOGPATH. "/");
|
||||||
|
define("DSTARREPEATERLOGFILENAME", "DStarRepeater_1-");
|
||||||
|
define("LINKLOGPATH", LOGPATH . "/Links.log");
|
||||||
|
define("HRDLOGPATH", LOGPATH . "/Headers.log");
|
||||||
|
break;
|
||||||
|
case "DL5DI_DEBIAN":
|
||||||
|
// Configuration for DL5DI-Installation-packages on DEBIAN
|
||||||
|
define("LOGPATH", "/var/log/opendv");
|
||||||
|
define("CONFIGPATH", "/home/opendv/ircddbgateway");
|
||||||
|
define("DSTARREPEATERLOGPATH", LOGPATH. "/");
|
||||||
|
define("DSTARREPEATERLOGFILENAME", "DStarRepeater_1-");
|
||||||
|
define("LINKLOGPATH", LOGPATH . "/Links.log");
|
||||||
|
define("HRDLOGPATH", LOGPATH . "/Headers.log");
|
||||||
|
break;
|
||||||
|
case "OTHER":
|
||||||
|
// Configuration for all others, please customize
|
||||||
|
// if necessary
|
||||||
|
define("LOGPATH", "/var/log");
|
||||||
|
define("CONFIGPATH", "/etc");
|
||||||
|
define("DSTARREPEATERLOGPATH", LOGPATH. "/");
|
||||||
|
define("DSTARREPEATERLOGFILENAME", "DStarRepeater-");
|
||||||
|
define("LINKLOGPATH", LOGPATH . "/Links.log");
|
||||||
|
define("HRDLOGPATH", LOGPATH . "/Headers.log");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
define("CONFIGFILENAME","ircddbgateway");
|
||||||
|
define("GATEWAYCONFIGPATH", CONFIGPATH."/".CONFIGFILENAME);
|
||||||
|
|
||||||
define("REFRESHAFTER","60");
|
define("REFRESHAFTER","60");
|
||||||
define("TEMPERATUREALERT",true);
|
define("TEMPERATUREALERT",true);
|
||||||
define("TEMPERATUREHIGHLEVEL", 60);
|
define("TEMPERATUREHIGHLEVEL", 60);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
function getLog() {
|
function getLog() {
|
||||||
// Open Logfile and copy loglines into LogLines-Array()
|
// Open Logfile and copy loglines into LogLines-Array()
|
||||||
$logLines = array();
|
$logLines = array();
|
||||||
if ($log = fopen(LOGFILE,'r')) {
|
if ($log = fopen(MMDVMLOGFILE,'r')) {
|
||||||
while ($logLine = fgets($log)) {
|
while ($logLine = fgets($log)) {
|
||||||
array_push($logLines, $logLine);
|
array_push($logLines, $logLine);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ function getHeardList($logLines) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($logLine,"end of")) {
|
if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired")) {
|
||||||
$lineTokens = explode(", ",$logLine);
|
$lineTokens = explode(", ",$logLine);
|
||||||
|
|
||||||
$duration = strtok($lineTokens[2], " ");
|
$duration = strtok($lineTokens[2], " ");
|
||||||
|
@ -158,6 +158,55 @@ function getActualMode($logLines) {
|
||||||
return "Idle";
|
return "Idle";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDSTARLinks() {
|
||||||
|
$out = "";
|
||||||
|
if ($linkLog = fopen(LINKLOGPATH,'r')) {
|
||||||
|
while ($linkLine = fgets($linkLog)) {
|
||||||
|
$linkDate = " ";
|
||||||
|
$protocol = " ";
|
||||||
|
$linkType = " ";
|
||||||
|
$linkSource = " ";
|
||||||
|
$linkDest = " ";
|
||||||
|
$linkDir = " ";
|
||||||
|
// Reflector-Link, sample:
|
||||||
|
// 2011-09-22 02:15:06: DExtra link - Type: Repeater Rptr: DB0LJ B Refl: XRF023 A Dir: Outgoing
|
||||||
|
// 2012-04-03 08:40:07: DPlus link - Type: Dongle Rptr: DB0ERK B Refl: REF006 D Dir: Outgoing
|
||||||
|
// 2012-04-03 08:40:07: DCS link - Type: Repeater Rptr: DB0ERK C Refl: DCS001 C Dir: Outgoing
|
||||||
|
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*Rptr: (.{8}).*Refl: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){
|
||||||
|
$linkDate = $linx[1][0];
|
||||||
|
$protocol = $linx[2][0];
|
||||||
|
$linkType = $linx[3][0];
|
||||||
|
$linkSource = $linx[4][0];
|
||||||
|
$linkDest = $linx[5][0];
|
||||||
|
$linkDir = $linx[6][0];
|
||||||
|
}
|
||||||
|
// CCS-Link, sample:
|
||||||
|
// 2013-03-30 23:21:53: CCS link - Rptr: PE1AGO C Remote: PE1KZU Dir: Incoming
|
||||||
|
if(preg_match_all('/^(.{19}).*(CC[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){
|
||||||
|
$linkDate = $linx[1][0];
|
||||||
|
$protocol = $linx[2][0];
|
||||||
|
$linkType = $linx[2][0];
|
||||||
|
$linkSource = $linx[3][0];
|
||||||
|
$linkDest = $linx[4][0];
|
||||||
|
$linkDir = $linx[5][0];
|
||||||
|
}
|
||||||
|
// Dongle-Link, sample:
|
||||||
|
// 2011-09-24 07:26:59: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming
|
||||||
|
// 2012-03-14 21:32:18: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming
|
||||||
|
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*User: (.{6,8}).*Dir: (.*)$/',$linkLine,$linx) > 0){
|
||||||
|
$linkDate = $linx[1][0];
|
||||||
|
$protocol = $linx[2][0];
|
||||||
|
$linkType = $linx[3][0];
|
||||||
|
$linkSource = " ";
|
||||||
|
$linkDest = $linx[4][0];
|
||||||
|
$linkDir = $linx[5][0];
|
||||||
|
}
|
||||||
|
$out .= $protocol . "-link to >" . $linkDest . "< " . $linkDir . "<br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
function getActualLink($logLines, $mode) {
|
function getActualLink($logLines, $mode) {
|
||||||
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
|
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
|
||||||
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
|
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
|
||||||
|
@ -165,12 +214,15 @@ function getActualLink($logLines, $mode) {
|
||||||
array_multisort($logLines,SORT_DESC);
|
array_multisort($logLines,SORT_DESC);
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case "D-Star":
|
case "D-Star":
|
||||||
|
/*
|
||||||
foreach ($logLines as $logLine) {
|
foreach ($logLines as $logLine) {
|
||||||
if (strpos($logLine, "D-Star link status set to")) {
|
if (strpos($logLine, "D-Star link status set to")) {
|
||||||
return substr($logLine, 54, strlen($logLine) - 56);
|
return substr($logLine, 54, strlen($logLine) - 56);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "not linked";
|
return "not linked";
|
||||||
|
*/
|
||||||
|
return getDSTARLinks();
|
||||||
break;
|
break;
|
||||||
case "DMR Slot 1":
|
case "DMR Slot 1":
|
||||||
foreach ($logLines as $logLine) {
|
foreach ($logLines as $logLine) {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Actual Mode</th>
|
<th>Actual Mode</th>
|
||||||
<th>D-Star last linked to</th>
|
<th>D-Star linked to</th>
|
||||||
<th>DMR TS1 last linked to</th>
|
<th>DMR TS1 last linked to</th>
|
||||||
<th>DMR TS2 last linked to</th>
|
<th>DMR TS2 last linked to</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -34,7 +34,6 @@ include "include/lh.php";
|
||||||
?>
|
?>
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
<?php
|
<?php
|
||||||
date_default_timezone_set("UTC");
|
|
||||||
$datum = date("d.m.Y");
|
$datum = date("d.m.Y");
|
||||||
$uhrzeit = date("H:i:s");
|
$uhrzeit = date("H:i:s");
|
||||||
echo "Last Update $datum, $uhrzeit";
|
echo "Last Update $datum, $uhrzeit";
|
||||||
|
|
Loading…
Reference in a new issue