[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sorting SNMP numeric OID's?
From: |
Ed Fair |
Subject: |
Sorting SNMP numeric OID's? |
Date: |
Mon, 22 Feb 2021 15:31:20 +0000 (UTC) |
Has it ever been discussed to add an option to the sort utility for sorting
numeric SNMP object identifiers by sub-identifier? For example, the output of
the command below?
$ snmptranslate -mUDP-MIB -TB -On '.*'
In this specific test case, there are no more than 11 fields, but this sort
does not have the desired effect: snmptranslate -mUDP-MIB -TB -On '.*' | sort
-t. -n -k1,11
The below command seems to work in this specific test case, but is not a
general-purpose solution:
$ snmptranslate -mUDP-MIB -TB -On '.*' | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4
-k5,5 -k6,6 -k7,7 -k8,8 -k9,9 -k10,10 -k11
Thanks in advance for your thoughts.
- Sorting SNMP numeric OID's?,
Ed Fair <=