#! /usr/bin/perl
use strict;
use warnings;
my @infos;
while(my $line = <DATA>){
my ($port) = $line =~ /ifLastChange\.(\d+)/;
my ($time) = $line =~ /Timeticks:\s\((\d+)\)/;
push(@infos,[$port,$time]);
}
for my $info(sort{$a->[1] <=> $b->[1]}@infos){
print "Port: ",$info->[0],"\tUptime: ",$info->[1],"\n";
}
# ohne leerzeichen:
_ _DATA_ _
IF-MIB::ifLastChange.1 = Timeticks: (219923100) 25 days, 10:53:51.00
IF-MIB::ifLastChange.2 = Timeticks: (291442830) 33 days, 17:33:48.30
IF-MIB::ifLastChange.3 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.4 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.5 = Timeticks: (291443150) 33 days, 17:33:51.50
IF-MIB::ifLastChange.6 = Timeticks: (413522130) 47 days, 20:40:21.30
IF-MIB::ifLastChange.7 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.8 = Timeticks: (300617070) 34 days, 19:02:50.70
IF-MIB::ifLastChange.9 = Timeticks: (291443150) 33 days, 17:33:51.50
IF-MIB::ifLastChange.10 = Timeticks: (219981820) 25 days, 11:03:38.20
IF-MIB::ifLastChange.11 = Timeticks: (219999180) 25 days, 11:06:31.80
IF-MIB::ifLastChange.12 = Timeticks: (301946910) 34 days, 22:44:29.10
IF-MIB::ifLastChange.13 = Timeticks: (220033420) 25 days, 11:12:14.20
IF-MIB::ifLastChange.14 = Timeticks: (221288170) 25 days, 14:41:21.70
IF-MIB::ifLastChange.15 = Timeticks: (24179410) 2 days, 19:09:54.10
IF-MIB::ifLastChange.16 = Timeticks: (516433680) 59 days, 18:32:16.80
IF-MIB::ifLastChange.17 = Timeticks: (516419040) 59 days, 18:29:50.40
IF-MIB::ifLastChange.18 = Timeticks: (516431600) 59 days, 18:31:56.00
IF-MIB::ifLastChange.19 = Timeticks: (543368960) 62 days, 21:21:29.60
IF-MIB::ifLastChange.20 = Timeticks: (468715520) 54 days, 5:59:15.20
IF-MIB::ifLastChange.21 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.22 = Timeticks: (505795440) 58 days, 12:59:14.40
IF-MIB::ifLastChange.23 = Timeticks: (508682160) 58 days, 21:00:21.60
IF-MIB::ifLastChange.24 = Timeticks: (531186240) 61 days, 11:31:02.40
IF-MIB::ifLastChange.25 = Timeticks: (543026560) 62 days, 20:24:25.60
IF-MIB::ifLastChange.26 = Timeticks: (540585440) 62 days, 13:37:34.40
IF-MIB::ifLastChange.27 = Timeticks: (567193920) 65 days, 15:32:19.20
IF-MIB::ifLastChange.28 = Timeticks: (543360160) 62 days, 21:20:01.60
IF-MIB::ifLastChange.29 = Timeticks: (324904140) 37 days, 14:30:41.40
IF-MIB::ifLastChange.30 = Timeticks: (543354720) 62 days, 21:19:07.20
IF-MIB::ifLastChange.31 = Timeticks: (540741200) 62 days, 14:03:32.00
IF-MIB::ifLastChange.32 = Timeticks: (544203200) 62 days, 23:40:32.00
IF-MIB::ifLastChange.33 = Timeticks: (532586320) 61 days, 15:24:23.20
IF-MIB::ifLastChange.34 = Timeticks: (539739520) 62 days, 11:16:35.20
IF-MIB::ifLastChange.35 = Timeticks: (317402830) 36 days, 17:40:28.30
IF-MIB::ifLastChange.36 = Timeticks: (526321280) 60 days, 22:00:12.80
IF-MIB::ifLastChange.37 = Timeticks: (516494640) 59 days, 18:42:26.40
IF-MIB::ifLastChange.38 = Timeticks: (516494000) 59 days, 18:42:20.00
IF-MIB::ifLastChange.39 = Timeticks: (393778460) 45 days, 13:49:44.60
IF-MIB::ifLastChange.40 = Timeticks: (482336080) 55 days, 19:49:20.80
IF-MIB::ifLastChange.41 = Timeticks: (301946910) 34 days, 22:44:29.10
IF-MIB::ifLastChange.42 = Timeticks: (220132380) 25 days, 11:28:43.80
IF-MIB::ifLastChange.43 = Timeticks: (220194060) 25 days, 11:39:00.60
IF-MIB::ifLastChange.44 = Timeticks: (291442830) 33 days, 17:33:48.30
IF-MIB::ifLastChange.45 = Timeticks: (526602400) 60 days, 22:47:04.00
IF-MIB::ifLastChange.46 = Timeticks: (524041440) 60 days, 15:40:14.40
IF-MIB::ifLastChange.47 = Timeticks: (0) 0:00:00.00
IF-MIB::ifLastChange.48 = Timeticks: (450) 0:00:04.50