fix(snmp): a disk listed late in UCD-DISKIO is read, and Asustor disks are named by bay (#5992)
The table walk stopped after 64 raw entries, counting the RAM disks, loops,
partitions and md arrays that rows_like then drops, so a Synology's eighth
disk was never reached. The walk is now bounded at 1,024 entries per column;
64 still caps the rows kept.
ADM labels its disks "Disk0".."Disk4" while their indexes run 1..5; the
Asustor disk table now names each row by its index ("Disk 1"). Keys are
unchanged, so history carries on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,12 @@ def test_a_table_row_is_keyed_by_its_index_and_named_by_its_label():
|
||||
assert got[0].states == "words"
|
||||
|
||||
|
||||
def test_an_asustor_disk_is_named_by_its_bay_not_adms_zero_based_label():
|
||||
disks = next(t for t in TABLES["asustor"] if t.id == "asustor_disks")
|
||||
got = table_readings(disks, [{"index": "1", "label": "Disk0", "columns": ["status"]}])
|
||||
assert [(r.key, r.name) for r in got] == [("disk1_status", "Disk 1 status")]
|
||||
|
||||
|
||||
def test_a_table_without_labels_is_named_by_its_columns():
|
||||
fans = Table("f", "", "", "Fan", (Column("9.2", "fan", "Fan speed", "rpm"),))
|
||||
[one] = table_readings(fans, [{"index": "1", "label": "", "columns": ["fan"]}])
|
||||
|
||||
Reference in New Issue
Block a user