Incorrect Port Sorting for Stacked Switches

Hey community

When viewing a stack of multiple 48-port switches in LibreNMS, the ports listing in the ports tab are not being sorted as expected. Instead of listing all ports on a switch sequentially from port 1 to port 48, LibreNMS is sorting ports in a way that groups the same port number across different switches together. For example, it lists ports 1-9 on switch 1, followed by ports 1-9 on switch 2, and so on, instead of displaying ports 1-48 on switch 1 first, followed by ports 1-48 on switch 2. Any way to fix this or is this now the expected behaviour?

===========================================

Component Version
LibreNMS 24.9.1 (2024-09-30T09:40:22+10:00)
DB Schema 2024_08_27_182000_ports_statistics_table_rev_length (300)
PHP 8.3.12
Python 3.9.20
Database MariaDB 10.6.19-MariaDB
RRDTool 1.9.0
SNMP 5.9.4.pre2
===========================================

[OK] Composer Version: 2.8.1
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Distributed Polling setting is enabled globally
[OK] Connected to rrdcached
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is functional
[INFO] fping FAILURES can be ignored if running LibreNMS in a jail without ::1. You may want to test it manually: fping ::1
[FAIL] /usr/local/sbin/fping6 could not be executed. /usr/local/sbin/fping6 must have CAP_NET_RAW capability (getcap) or suid. Selinux exclusions may be required.
(/usr/local/sbin/fping6: can’t create socket (must run as root?))
[OK] rrdtool version ok
[OK] Connected to rrdcached
[WARN] Log rotation not enabled, could cause disk space issues
[FIX]:
sudo cp /usr/local/www/nginx/misc/librenms.logrotate /etc/logrotate.d/librenms
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
dist/librenms.cron
includes/port-descr-parser.inc.php

To further add, it’s been like this since 24.7.0 and i think from the following PR

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

By default, it sorts the way you want. But, if you ever clicked to sort another way, that is saved to your user and you cannot go back to ifIndex sort :slight_smile:

Try Ports: show ifIndex to allow restoring sort to ifIndex by murrant · Pull Request #18374 · librenms/librenms · GitHub