[rrd-users] script from rrdtutorial

Jean-Michel Kelbert jean-michel at kelbert.com
Mon Jul 30 11:25:44 MEST 2001


Hi,

Could you tell me where I can find the script :

while not the end of the universe
   do
      get result of
         snmpget router community 2.2.1.10.4
      into variable $in
      get result of
         snmpget router community 2.2.1.16.4
      into variable $out

      rrdtool update myrouter.rrd N:$in:$out

      wait for 5 minutes
   done

in perl ! I am an beginner in perl so I tried to do something but it
doesn't work :

#! /usr/bin/perl
 
use strict;
use vars qw($session $error $response_in $response_out);
 
use Net::SNMP;
($session, $error) = Net::SNMP->session(
   -hostname  => shift || 'intel',
   -community => shift || 'public'
 
);
 
if (!defined($session)) {
   printf("ERROR: %s.\n", $error);
   exit 1;
}
my $in = '2.2.1.10.1';
#my $out = '2.2.1.10.4';
 
if (!defined($response_in = $session->get_request($in))) {
   printf("ERROR: %s.\n", $session->error());
   $session->close();
   exit 1;
}
 
#if (!defined($response_out = $session->get_request($out))) {
#   printf("ERROR: %s.\n", $session->error());
#   $session->close();
#   exit 1;
#}
 
#system("rrdtool update intel.rrd
N:$response_in->{$in}:$response_in->{$out}");
 
$session->close();
 
exit 0;

I ve got this error :

ERROR: Received SNMP noSuchName(2) error-status at error-index 1.  


-- 
Jean-Michel Kelbert

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list