#! /usr/bin/perl # Per SNMP Prozessliste von einem Primergy-Server holen # Syntax: plist -host=xxx [-community=xxx] # Es werden alle laufenden Prozesse alphabetisch sortiert # ausgegeben. ################################################################# use Getopt::Long; $\ = "\n"; $, = "\n"; my $host = 'localhost'; my $community = 'public'; my $timeout = 4; my $identifier = '.1.3.6.1.4.1.231.2.10.2.1.17.1.4'; my $help = ""; my $USAGE = < \$host, "community=s" => \$community, "help" => \$help); if ($help) { die "$USAGE"; } $CMD = "snmpwalk $host $community $identifier"; $output = `$CMD`; $output =~ s/.+ = "//g; $output =~ s/"//g; @liste = split($\,$output); @sortlist = sort @liste; print @sortlist;