[rrd-users] Re: RRD-tool - Windows NT

Leo Le lle at socccd.cc.ca.us
Fri Jun 9 18:33:26 MEST 2000


Hi Feil,
I do not know exactly that your question is about rrdtool installation that is
not working or you do not know how to use SNMPget to extract the OID values.
Are you able to do steps explained in the tutorial ? ( thanks Alex ) For NT,
the rrd installation is much simpler ( thanks much Simonet ). Anyway, I include
a copy of my script that uses SNMP_util to collect and generates rrd files.
Please don't laugh, it is so simple but it works for me. My Perl program is at
level 1. I also attach a copy of SNMP_util just in case.
By the way, your version should be OK. I used ver 1.0.7 because I started
rrdtool at that time. As you can see, it took me a llong time to get what I
need.
Then you need to setup your NT for cgi and write a Perl script that using
RRD::graph to generate the graphs from rrd files.
Hope this help.
Leo Le
#!/usr/local/bin/perl
use lib qw(c:\\rrd107\\arch\\auto\\RRDs c:\\rrd107\\lib c:\\mrtg288\\run);
use strict;
use CGI qw(:standard);
use SNMP_util;
use RRDs;
#-----------------------------------------------------------------
my $now=time;
my
($inUcasts11,$inNUcasts12,$outUcasts17,$outNUcasts18,$inOctets10,$outOctets16,$inDiscards13,$outDiscards19);

my $base="c:\\InetPub\\wwwroot\\mrtgdata\\";
my $ERROR=RRDs::error();
#-----------------------------------------------------
my $name="c:\\InetPub\\wwwroot\\mrtgdata\\dlist.txt";
my @DLIST=();
my $num = 0;
my ( $rrd, $ipaddr, $port, $limit );
#
#--------------------------------------
my @options1=("DS:inUcasts11:COUNTER:600:U:U",
"DS:inNUcasts12:COUNTER:600:U:U", "DS:outUcasts17:COUNTER:600:U:U",
"DS:outNUcasts18:COUNTER:600:U:U", "DS:inOctets10:COUNTER:600:U:U",
"DS:outOctets16:COUNTER:600:U:U", "DS:inDiscards13:COUNTER:600:U:U",
"DS:outDiscards19:COUNTER:600:U:U");
my @options2=("RRA:AVERAGE:0.5:1:600", "RRA:AVERAGE:0.5:6:600",
"RRA:AVERAGE:0.5:24:600", "RRA:AVERAGE:0.5:288:732");
my @options3=("RRA:MAX:0.5:1:600", "RRA:MAX:0.5:6:600", "RRA:MAX:0.5:24:600",
"RRA:MAX:0.5:288:732");
#
#--------------------------------------
open (IN,$name)|| die " can't open dlist.txt file";
@DLIST=<IN>;
close (IN)|| die " can't close dlist.txt";
$limit=$#DLIST;
#print "$limit\n";
#--------------------------------------
while ($num < $limit){
 chomp ($DLIST[$num]);
 $rrd="$base$DLIST[$num]".".rrd";
 chomp ($DLIST[++$num]);
 $ipaddr=$DLIST[$num];
 chomp ($DLIST[++$num]);
 $port=$DLIST[$num];
#------------------ create rrds--------------------------
#
 if (! -e $rrd) {
 $now=($now/100)*100;
 RRDs::create ("$rrd", "-b", $now, "-s", "300", @options1, @options2,
@options3);
 ++$num;
 if($ERROR=RRDs::error()){
 die "$0:unable to create '$rrd': $ERROR\n";
     }
 }else {
#
#-------------------update-------------------------------
#
($inUcasts11,$inNUcasts12,$outUcasts17,$outNUcasts18,$inOctets10,$outOctets16,$inDiscards13,$outDiscards19)=&snmpget("public\@$ipaddr","1.3.6.1.2.1.2.2.1.11.$port","1.3.6.1.2.1.2.2.1.12.$port","1.3.6.1.2.1.2.2.1.17.$port","1.3.6.1.2.1.2.2.1.18.$port","1.3.6.1.2.1.2.2.1.10.$port","1.3.6.1.2.1.2.2.1.16.$port","1.3.6.1.2.1.2.2.1.13.$port","1.3.6.1.2.1.2.2.1.19.$port");

# print
"$inUcasts11,$inNUcasts12,$outUcasts17,$outNUcasts18,$inOctets10,$outOctets16,$inDiscards13,$outDiscards19\n";

 RRDs::update ("$rrd",
"N:$inUcasts11:$inNUcasts12:$outUcasts17:$outNUcasts18:$inOctets10:$outOctets16:$inDiscards13:$outDiscards19");

 ++$num;
#print "$num\n$rrd\n$ipaddr\n$port\n";
 if($ERROR=RRDs::error()){
  die "$0:unable to update '$rrd': $ERROR\n";
     }
 }
}
#----------------------------------------------------------
Feil Alexander wrote:

> Hi Leo Le!
>
> In your last email i read that you using der version  ... NT.
> Is that the version for using with windows NT like NT 4.0 ore MS Windows
> 2000?
>
> I try to run the rrd-tool with windows 2000, but i have no success!
> I use vers. rrdtool-1_0_20_x86distr; ActivePerl-5_6_0_613.msi;
>
> In the documentation i read that i have to use the tool "snmpget" for
> reading the snmp information of the routers and switches.
> So i looked for this tool in the web, but i only find tools for Linux
> systems.
>
> Please can you send me some information about your tool for useing snmpget,
> and other used tools for rrd-toll!?
>
> Thankyou for helping
>
> regards
> Alexander
>
>
> PS: Sorry for my bad english!
>
> SIEMENS AG
> Stuttgart
> ICN VD SV IB
>
> Alexander Feil
>
> Weissacher Strasse 11
> 70499 Stuttgart
>
> mailto:Alexander.Feil at stg.siemens.de
>
> > -----Ursprüngliche Nachricht-----
> > Von:  Leo Le [SMTP:lle at socccd.cc.ca.us]
> > Gesendet am:  Donnerstag, 8. Juni 2000 19:29
> > An:   RRD User Mailing List
> > Betreff:      [rrd-users] RRDs::last timestamp on NT
> >
> > Hello,
> > I tried to get the last updated time of one .rrd file, the returned time
> > timestamp is always the same.
> > I am trying :
> >     my $lasttime = scalar localtime ( RRDs::last ("$rrd"));
> >     print ("my last time is : $lasttime");
> > The result is 0 0 16 31 11 69 3 364 0
> > Or   Wed Dec 31 16:00:00 1969
> > My version is a little old:  rrdtool ver 1.0.7 NT .
> > Any help would be appreciated.
> > Leo Le
> >
> >
> > --
> > 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


-- Attached file removed by Listar and put at URL below --
-- Type: text/plain
-- Size: 26k (26845 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/SNMP_util.pm


--
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



More information about the rrd-users mailing list