Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ChangeLog

--- develop ---
* issue: Fix the Fleet Dashboard Uptime Distribution showing all zeros by falling back to SNMP sysUpTime when the Host Resources hrSystemUptime is not reported, and apply the same fallback to the per-device Dashboard
* issue: Stop the Dashboard card header from changing height when hovering the drag handle or tool buttons by reserving space for the theme's button hover border
* feature: Make the Fleet Dashboard the first tab and the default landing view on the Host MIB interface
* feature: Add a Fleet (Summary) Dashboard reached by a dashboard glyph on the Summary tab's Device Type rows: a draggable, add/remove card grid scoped to all devices or one OS type, with min/avg/max bullet charts (CPU/memory/swap/processes/uptime), a device-status stacked bar, OS type distribution, storage utilization, fleet stat tiles, and top processes by CPU and by memory; scope, card order, expanded state and refresh interval persist per user
* issue: Make the per-device Dashboard device picker an AJAX callback (a Cacti drop_callback that searches Host MIB devices server-side via ?action=ajax_hosts) instead of rendering every host as an <option>, so installs with tens of thousands of devices no longer bloat the page
Expand Down
11 changes: 7 additions & 4 deletions hmib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4223,7 +4223,8 @@ function hmib_dashboard_card_body(string $key, int $host_id): string {
$kv(__('Description', 'hmib'), (string) $system['sysDescr']);
$kv(__('Contact', 'hmib'), (string) $system['sysContact']);
$kv(__('Location', 'hmib'), (string) $system['sysLocation']);
$kv(__('Uptime', 'hmib'), hmib_dashboard_format_uptime((int) $system['uptime']));
// hrSystemUptime (uptime) is often unreported by agents that still serve sysUpTime.
$kv(__('Uptime', 'hmib'), hmib_dashboard_format_uptime((int) $system['uptime'] > 0 ? (int) $system['uptime'] : (int) $system['sysUptime']));
$kv(__('System Time', 'hmib'), (string) $system['date']);
print '</tbody></table>';

Expand Down Expand Up @@ -4864,6 +4865,8 @@ function hmib_summary_stats(int $ostype): array {
$where = $ostype >= 0 ? 'WHERE hrs.host_type = ?' : '';
$params = $ostype >= 0 ? [$ostype] : [];

// hrSystemUptime (uptime) is often unreported (0) by agents that still serve
// sysUpTime (sysUptime), so fall back to it for the uptime distribution.
$row = db_fetch_row_prepared("SELECT
COUNT(*) AS devices,
SUM(host_status = 3) AS up,
Expand All @@ -4886,9 +4889,9 @@ function hmib_summary_stats(int $ostype): array {
MIN(CASE WHEN host_status >= 2 THEN processes END) AS minProc,
AVG(CASE WHEN host_status >= 2 THEN processes END) AS avgProc,
MAX(CASE WHEN host_status >= 2 THEN processes END) AS maxProc,
MIN(CASE WHEN host_status >= 2 THEN uptime END) AS minUptime,
AVG(CASE WHEN host_status >= 2 THEN uptime END) AS avgUptime,
MAX(CASE WHEN host_status >= 2 THEN uptime END) AS maxUptime
MIN(CASE WHEN host_status >= 2 THEN IF(uptime > 0, uptime, sysUptime) END) AS minUptime,
AVG(CASE WHEN host_status >= 2 THEN IF(uptime > 0, uptime, sysUptime) END) AS avgUptime,
MAX(CASE WHEN host_status >= 2 THEN IF(uptime > 0, uptime, sysUptime) END) AS maxUptime
FROM plugin_hmib_hrSystem AS hrs
$where", $params);

Expand Down
Loading