summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting
diff options
context:
space:
mode:
authorSteffen Ritter2022-01-31 17:19:53 +0100
committerSteffen Ritter2022-01-31 17:19:53 +0100
commita20a7b3c301bb747b195d90cb8d966459eb5f587 (patch)
treeae4f65f1c68d67a88fbd96a070c4359e2f36080f /modules-available/statistics_reporting
parent[statistics_reporting] Always send a minimal report (diff)
downloadslx-admin-a20a7b3c301bb747b195d90cb8d966459eb5f587.tar.gz
slx-admin-a20a7b3c301bb747b195d90cb8d966459eb5f587.tar.xz
slx-admin-a20a7b3c301bb747b195d90cb8d966459eb5f587.zip
[statistics_reporting] Gather some more os infos
* IP address * Hostname by reverse lookup on IP * OS name/version
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r--modules-available/statistics_reporting/inc/remotereport.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/statistics_reporting/inc/remotereport.inc.php b/modules-available/statistics_reporting/inc/remotereport.inc.php
index 98f366b6..fec78542 100644
--- a/modules-available/statistics_reporting/inc/remotereport.inc.php
+++ b/modules-available/statistics_reporting/inc/remotereport.inc.php
@@ -106,6 +106,7 @@ class RemoteReport
$cpuInfo = file_get_contents('/proc/cpuinfo');
$uptime = file_get_contents('/proc/uptime');
$memInfo = file_get_contents('/proc/meminfo');
+ $osInfo = parse_ini_file('/etc/os-release');
preg_match_all('/\b(\w+):\s+(\d+)\s/s', $memInfo, $out, PREG_SET_ORDER);
$mem = array();
foreach ($out as $e) {
@@ -126,6 +127,14 @@ class RemoteReport
$data['swapTotal'] = $mem['SwapTotal'];
$data['swapUsed'] = ($mem['SwapTotal'] - $mem['SwapFree']);
}
+
+ $data['ip'] = $_SERVER['SERVER_ADDR'];
+ $data['hostname'] = strtolower(gethostbyaddr($_SERVER['SERVER_ADDR']));
+
+ $data['osID'] = $osInfo['ID'];
+ $data['osVersionID'] = $osInfo['VERSION_ID'];
+ $data['osVersionCodename'] = $osInfo['VERSION_CODENAME'];
+
return $data;
}