my ( $session, $error ) = Net::SNMP->session( -hostname => $host, -version => '1', -community => $nodes{$host}->{community}, ); if ( !defined($session) ) { printf("ERROR: sub snmp session undef\n"); } my $num = $snmp->get_request( -varbindlist => [$rrd{$rrd}{$type}] ) if ( !defined($num) ) { printf( "ERROR: %s.\n", $session->error ); }