diff options
author | Simon Rettberg | 2023-09-25 15:25:02 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-09-25 15:25:02 +0200 |
commit | e440e54e36a5a79555b7ff8275cc50138d8ea766 (patch) | |
tree | 981a5a262bcc556d34a30bd49f9f78052f467c79 /modules-available/statistics/pages | |
parent | [rebootcontrol] Make subnet deletion timoeut match that of machines (diff) | |
download | slx-admin-e440e54e36a5a79555b7ff8275cc50138d8ea766.tar.gz slx-admin-e440e54e36a5a79555b7ff8275cc50138d8ea766.tar.xz slx-admin-e440e54e36a5a79555b7ff8275cc50138d8ea766.zip |
[statistics] Add hints for old CPUs (to be implemented on client)
Diffstat (limited to 'modules-available/statistics/pages')
-rw-r--r-- | modules-available/statistics/pages/hints.inc.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php index 55dbca52..fbde5b45 100644 --- a/modules-available/statistics/pages/hints.inc.php +++ b/modules-available/statistics/pages/hints.inc.php @@ -14,6 +14,7 @@ class SubPage if (in_array(0, $locs)) { $locs = []; } + self::showLegacyCpu($locs); self::showMemoryUpgrade($locs); self::showSlowNics($locs); self::showUnusedSpace($locs); @@ -190,4 +191,28 @@ class SubPage Render::addTemplate('hints-nic-speed', ['list' => $list]); } + /** + * Show machines that have a CPU that is only supported by VMware 12.5.x, + * but not newer versions. + */ + private static function showLegacyCpu(array $locs) + { + $list = []; + $q = new HardwareQuery(HardwareInfo::CPU); + if (!empty($locs)) { + $q->addMachineWhere('locationid', 'IN', $locs); + } + $q->addMachineWhere('lastseen', '>', strtotime('-60 days')); + $q->addMachineColumn('clientip'); + $q->addMachineColumn('hostname'); + $q->addMachineColumn('state'); + $q->addMachineColumn('cpumodel'); + $q->addGlobalColumn('vmx-legacy')->addCondition('<>', 0); + $list = $q->query()->fetchAll(); + if (empty($list)) + return; + ArrayUtil::sortByColumn($list, 'hostname'); + Render::addTemplate('hints-cpu-legacy', ['list' => $list]); + } + }
\ No newline at end of file |