#! /usr/local/bin/perl use strict; use Net::SNMP; my ($session, $error) = Net::SNMP->session( -hostname => shift || '127.0.0.1', -community => shift || 'public', -port => shift || 161 ); if (!defined($session)) { printf("ERROR: %s.\n", $error); exit 1; } my $response = $session->get_next_request('1.3.6.1.2.1.1'); my @nextid = keys %$response; while ( $nextid[0] =~ m/^1\.3\.6\.1\.2\.1\.1/ ) { $response = $session->get_next_request( $nextid[0] ); @nextid = keys %$response; print "durchlaufe OID: $nextid[0] \n"; #fuer diese OID nun Werte abholen etc. }