You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR extends the Monitor dashboard across several areas. Each feature is realm/permission-gated and schema-aware where it integrates with other plugins.
1. Rows filter → List view only
Pagination (the Rows/Devices count) now applies only to the List view; all other views show every matching device, and the Rows dropdown is hidden on non-list pages (with a hidden fallback input so the saved value survives a view switch).
2. plugin_servcheck integration + distinct status
Hover tooltip now detects a triggered/failing service check on a device (matched by hostname/ipaddress, schema-aware across servcheck v0.3 lastcheck/failures and v0.4 last_check/last_result), promoting an otherwise-Up device and adding a glyph linking to the failing check. Realm-gated behind servcheck_test.php.
A distinct Service Check Failed device status (code 10) with its own legend chip, tile/list colour and status-filter coverage, driven by a realm-gated checkServchecks() host set (mirrors checkTholds()).
3. Tiles & Time sizing
*_tilesadt tiles use min-height + box-sizing: border-box so a tile's bounding box grows to contain the glyph, hostname and uptime instead of overflowing neighbours.
A non-sortable Actions column (first column) opens a modal of intropage-style cards for one device:
Host Information (description, hostname, status pill, site, device template, location, SNMP uptime/contact)
Data Collection timing (availability method, ping min/avg/cur/max, availability %, total/failed polls, last fail)
Service Checks (servcheck, realm-gated, schema-aware; Not-tested/OK/Failing/Disabled states)
Thresholds (thold, gated behind the thold_graph.php realm)
Syslog (last hour, realm-gated, loads syslog's own DB connection)
Device Links (edit device, view graphs, "Open Actual Device" with bracketed IPv6)
Security scope: the ajax_hostpanel and ajax_status endpoints enforce is_device_allowed(), so a user cannot pull details for a device omitted from their board. Each plugin card is additionally gated behind that plugin's realm.
5. Dashboard restructure
plugin_monitor_dashboards now stores filter state as a JSON properties column instead of a raw url. The upgrade migrates each legacy url into the properties structure and drops the url column. Dashboards are loaded/applied from the structure; URLs are constructed client-side from the restored filter vars.
6. Grouping card panels
The Site and Device Template groupings render as a responsive full-width grid of card panels (up to ~8 columns, shrinking on narrower screens). Each title is coloured by the group's worst device status. Cards are draggable; the order is persisted in the dashboard's properties.cardorder (or the per-user monitor_cardorder setting) and reapplied on render.
Testing
php -l clean across all changed PHP.
Pest unit tests added for the servcheck helpers (getHostTriggeredServchecks, checkServchecks), the status-filter wiring, and the dashboard url→properties migration; harness-validated the panel cards, grouping colorization/ordering, schema-aware states, and IPv6 link bracketing.
locales/po/cacti.pot regenerated for the new strings.
… Time tile box
Rows filter now only paginates/shows on the List view; non-list views show all devices. Add plugin_servcheck hover status + glyph alongside thold/syslog. Fix Tiles & Time tiles overflowing their bounding box via min-height.
- getHostTriggeredServchecks adapts to servcheck v0.3 (lastcheck/failures) and v0.4 (last_check/last_result) schemas and guards a missing table
- Gate the hover status promotion behind the servcheck_test.php realm, matching the glyph link
- Regenerate locales/po/cacti.pot for 'View Failing Service Check'
- Add unit coverage for the servcheck helper (disabled/empty/missing-table exits, bound params, v0.3 & v0.4 predicates)
… panels
- Add status 10 (Service Check Failed) with legend chip, tile/list colour and status-filter coverage via a realm-gated, schema-aware checkServchecks() host set
- Add a non-sortable Actions column to the List view opening a modal of intropage-style cards: host info, data collection timing, service checks, thresholds, last-hour syslog, and device links
- Regenerate cacti.pot; add unit coverage for checkServchecks() and the servcheck status filter
…anels
- Restructure plugin_monitor_dashboards to a JSON properties column; migrate the legacy url into it and drop the url column on upgrade; load/save dashboards via the structure
- Render Site and Device Template groupings as a responsive grid of draggable card panels, titles coloured by each group's worst device status, with per-dashboard/per-user persisted ordering
- Add unit coverage for the url->properties migration and db stubs
…, thold realm
- Enforce is_device_allowed() on ajax_hostpanel and ajax_status so a user cannot pull details for a device off their board
- Gate the Thresholds card behind thold's thold_graph.php realm
- Select the schema-specific servcheck check time (lastcheck/last_check) and use it so never-run v0.3 checks report Not tested
- Bracket IPv6 literals in the Open Actual Device link
The Cacti host field is snmp_sysUpTimeInstance (capital T in UpTime), and PHP array keys are case-sensitive. The current key therefore never exists on the fetched host row, so the new Host Information panel always omits SNMP uptime.
- Save/read grouping card order via the dashboard only when the user owns it; shared/read-only dashboards and no-dashboard fall back to the per-user monitor_cardorder setting so reorders persist
- Read the posted order through get_nfilter_request_var() instead of \ directly
The properties payload omits the active template and rfilter values even though both are posted by saveFilter()/saveNewDashboard(). A dashboard saved for one device template or search therefore reloads without that filter (and can retain the prior session value instead), so these filter variables need to be persisted with the rest.
Use correct snmp_sysUpTimeInstance key
includes/controller.php:1471
This uses snmp_sysUptimeInstance, but the host row exposes Cacti's snmp_sysUpTimeInstance key (as used by the existing tooltip and poller code). Because PHP array keys are case-sensitive, the condition is always false and the promised SNMP Uptime row never renders.
Treat v0.3 failures as failing when not triggered
includes/controller.php:1555
On the v0.3 schema, $has_result is false and this condition only checks triggered, so a test with failures > 0 but not yet triggered is displayed as OK. The v0.3 predicates in getHostTriggeredServchecks() and checkServchecks() classify that same state as failing; include failures > 0 when last_result is unavailable so the panel agrees with the device status.
Prevent card order properties column overflow
includes/database.php:101
cardorder contains every site/template group ID and both grouping arrays can accumulate in one JSON document, but varchar(4096) imposes a small fixed ceiling. With a few hundred groups the update in saveCardOrder() exceeds this column and order persistence fails or truncates the properties, including saved filters. Use a text-capable column consistently in both the table definition and migration add-column call.
Make ordering controls keyboard accessible
js/monitor.js:366
The new ordering interaction is only exposed through jQuery UI Sortable with an <i> drag handle, which is neither focusable nor keyboard-operable. Keyboard-only users cannot perform the same reorder action. Add semantic focusable controls and keyboard move behavior (with an announced position change), while retaining drag-and-drop as the pointer interaction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the Monitor dashboard across several areas. Each feature is realm/permission-gated and schema-aware where it integrates with other plugins.
1. Rows filter → List view only
Pagination (the Rows/Devices count) now applies only to the List view; all other views show every matching device, and the Rows dropdown is hidden on non-list pages (with a hidden fallback input so the saved value survives a view switch).
2. plugin_servcheck integration + distinct status
lastcheck/failuresand v0.4last_check/last_result), promoting an otherwise-Up device and adding a glyph linking to the failing check. Realm-gated behindservcheck_test.php.checkServchecks()host set (mirrorscheckTholds()).3. Tiles & Time sizing
*_tilesadttiles usemin-height+box-sizing: border-boxso a tile's bounding box grows to contain the glyph, hostname and uptime instead of overflowing neighbours.4. List-view Actions column + device detail dialog
A non-sortable Actions column (first column) opens a modal of intropage-style cards for one device:
thold_graph.phprealm)Security scope: the
ajax_hostpanelandajax_statusendpoints enforceis_device_allowed(), so a user cannot pull details for a device omitted from their board. Each plugin card is additionally gated behind that plugin's realm.5. Dashboard restructure
plugin_monitor_dashboardsnow stores filter state as a JSONpropertiescolumn instead of a rawurl. The upgrade migrates each legacy url into the properties structure and drops theurlcolumn. Dashboards are loaded/applied from the structure; URLs are constructed client-side from the restored filter vars.6. Grouping card panels
The Site and Device Template groupings render as a responsive full-width grid of card panels (up to ~8 columns, shrinking on narrower screens). Each title is coloured by the group's worst device status. Cards are draggable; the order is persisted in the dashboard's
properties.cardorder(or the per-usermonitor_cardordersetting) and reapplied on render.Testing
php -lclean across all changed PHP.getHostTriggeredServchecks,checkServchecks), the status-filter wiring, and the dashboard url→properties migration; harness-validated the panel cards, grouping colorization/ordering, schema-aware states, and IPv6 link bracketing.locales/po/cacti.potregenerated for the new strings.