#!/bin/sh (for host in mithrandir; do echo -n "$host " snmpget -v1 -c public $host host.hrSystem.hrSystemUptime.0 2> /dev/null || echo "" done) | perl -ane ' $F[4] =~ s/[()]//g; print "$F[4] $F[0]: "; for ($i = 0; $i < 5; $i++) { shift @F; } print(join(" ", @F), "\n"); ' | sort -rn | head -1 | cut -f 2- -d ' '