diff --git a/client.js b/client.js index b1baf5c..98ca294 100644 --- a/client.js +++ b/client.js @@ -65,7 +65,7 @@ monitor_client = { console.error(err); } finally { /* send the next heartbeat signal after x seconds: */ - setTimeout(this._onHeartbeat.bind(this, this._src.replace( this._scriptName, '/tock.php')),this._heartbeat * 1000); + setTimeout(this._onHeartbeat.bind(this, this._src.replace( this._scriptName, '/tick.php')),this._heartbeat * 1000); } } } diff --git a/logs/2025-08-20.log b/logs/2025-08-20.log deleted file mode 100644 index 93997b9..0000000 --- a/logs/2025-08-20.log +++ /dev/null @@ -1,20 +0,0 @@ -2025-08-20 19:06:51 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:08:55 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:08:58 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:13:07 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:13:22 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:14:10 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:16:02 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:18:04 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:18:27 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:28:44 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:03 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:07 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:08 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:41:14 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:42:22 ::1 playground:index l95kv2efjemi3ccq0n27ovcupp null -2025-08-20 19:42:41 ::1 playground:index l95kv2efjemi3ccq0n27ovcupp null -2025-08-20 19:42:50 ::1 playground:index l95kv2efjemi3ccq0n27ovcupp null -2025-08-20 19:44:10 ::1 playground:index hh43pvar70lpbg6d3kol60kcth null -2025-08-20 19:44:31 ::1 playground:index hh43pvar70lpbg6d3kol60kcth null -2025-08-20 19:57:29 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator diff --git a/logs/2025-08-20.srv b/logs/2025-08-20.srv deleted file mode 100644 index a12dbb4..0000000 --- a/logs/2025-08-20.srv +++ /dev/null @@ -1,19 +0,0 @@ -2025-08-20 19:08:54 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:08:58 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:13:06 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:13:22 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:14:09 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:16:01 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:18:04 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:18:27 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:28:44 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:03 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:07 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:40:08 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:41:14 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator -2025-08-20 19:42:22 ::1 playground:index – -2025-08-20 19:42:41 ::1 playground:index l95kv2efjemi3ccq0n27ovcupp -2025-08-20 19:42:50 ::1 playground:index l95kv2efjemi3ccq0n27ovcupp -2025-08-20 19:44:10 ::1 playground:index – -2025-08-20 19:44:31 ::1 playground:index hh43pvar70lpbg6d3kol60kcth -2025-08-20 19:57:29 127.0.0.1 playground:index cn2d1mn0spa8rv861tbc25ui2g Administrator Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:141.0) Gecko/20100101 Firefox/141.0 diff --git a/logs/2025-08-20.tck b/logs/2025-08-20.tck deleted file mode 100644 index acbe3f0..0000000 --- a/logs/2025-08-20.tck +++ /dev/null @@ -1,6 +0,0 @@ -2025-08-20 19:29:14 1755718154605 playground:index 127.0.0.1 cn2d1mn0spa8rv861tbc25ui2g 1755718154605 -2025-08-20 19:40:38 1755718838992 playground:index 127.0.0.1 cn2d1mn0spa8rv861tbc25ui2g 1755718838992 -2025-08-20 19:41:44 1755718904549 playground:index 127.0.0.1 cn2d1mn0spa8rv861tbc25ui2g 1755718904549 -2025-08-20 19:43:20 1755719000646 playground:index ::1 l95kv2efjemi3ccq0n27ovcupp 1755719000646 -2025-08-20 19:45:01 1755719101444 playground:index ::1 hh43pvar70lpbg6d3kol60kcth 1755719101444 -2025-08-20 19:57:59 1755719879708 playground:index 127.0.0.1 cn2d1mn0spa8rv861tbc25ui2g 1755719879708 diff --git a/logs/logfiles.txt b/logs/logfiles.txt new file mode 100644 index 0000000..a208804 --- /dev/null +++ b/logs/logfiles.txt @@ -0,0 +1,8 @@ +This folder will hold the log files for the monitoring tool. + +There will be three files per day, each with the current day +as file name (in UTC timing), with the following endings: + + - .srv – Logs each time a DokuWiki file is served. + - .log – Logs each page-load + - .tck – Logs every 30 seconds while a visitor is on a page. \ No newline at end of file diff --git a/plugin.info.txt b/plugin.info.txt index c45079a..2d75298 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base monitor author Sascha Leib email ad@hominem.com -date 2025-08-20 +date 2025-08-21 name Monitoring desc Live monitoring traffic on your DokuWiki instance (under development) -url https://www.dokuwiki.org/plugin:nustats +url https://www.dokuwiki.org/plugin:monitor diff --git a/tick.php b/tick.php index 3d56cf7..efa2de1 100644 --- a/tick.php +++ b/tick.php @@ -2,11 +2,9 @@ /* build the resulting log line (ensure fixed column positions!) */ $logArr = Array( - intval($_GET['t']), /* timestamp */ - $_GET['p'] ?? null, /* page ID */ $_SERVER['REMOTE_ADDR'] ?? 'null', /* remote IP */ - $_COOKIE['DokuWiki'] ?? 'null', /* DokuWiki session ID */ - $_GET['t'] ?? null /* client time */ + $_GET['p'] ?? null, /* page ID */ + $_COOKIE['DokuWiki'] ?? 'null' /* DokuWiki session ID */ ); /* create the log line */