#!/usr/bin/env perl # $Id: diagrams.pl,v 1.13 2004/05/23 23:53:38 bernisys Exp $ # include PERL libraries use strict; use warnings; use diagnostics; # include HotSaNIC libraries use lib "../../lib"; use lib "./platform"; use HotSaNICparser; use HotSaNICdiagram; use common; (my $VERSION = '$Revision: 1.13 $') =~ s/.*(\d+\.\d+).*/$1/; (my $IDENTIFIER = '$Id: diagrams.pl,v 1.13 2004/05/23 23:53:38 bernisys Exp $') =~ s/.*,v (.*) \$/$1/; # read all settings # my $MODNAME=HotSaNICparser::get_module_name(); my %CONFIG=HotSaNICparser::get_config("../.."); my %MODULECONFIG=HotSaNICmod::common::configure(); my $IMGFMT=lc $CONFIG{"IMAGEFORMAT"}; my $OUTDIR=$CONFIG{"WEBDIR"}."/".lc $MODNAME; if ( ! -e $OUTDIR ) { mkdir $OUTDIR,0755; } my ($FORCE,$DEBUGLEVEL,%PLOT)=HotSaNICdiagram::check_args(@ARGV); my @OPTIONS=HotSaNICdiagram::get_common_options(%MODULECONFIG,%CONFIG); # handle module-specific stuff # push @OPTIONS,( "--alt-autoscale-max"); # alternate scaling my @COLORS=("#a00000","#00a000","#0000a0","#00a0a0","#a000a0","#a0a000","#a0a0a0", "#f00000","#00f000","#0000f0","#00f0f0","#f000f0","#f0f000","#f0f0f0"); opendir DIR,"rrd"; my @files=grep /\.rrd/,readdir DIR; closedir DIR; # generate diagrams # foreach my $dev ("rc5","des","ogr","csc") { if (%PLOT) { next if ! defined $PLOT{$dev}; } my $name=$dev; my $description=$dev; my $LEGEND="keys/s"; if ($dev eq "ogr") { $LEGEND="nodes/s"; } # if ($var eq "NETWORK") { # unshift @ITEMS,$value; # if database exists, create images... print "creating images for $description...\n"; if (@files) { foreach my $range ("1week","1month","1year") { my ($descr,$file,$build,$fullrange,$DATESTRING)=HotSaNICdiagram::get_diagram_properties($range); my @EXTOPTIONS=("-v", $LEGEND, "-s","-$range", "--title", "$name stats - last $descr ($DATESTRING)"); my @COMMANDS=(); my $COLOR_NUM=0; my $FIRST="true"; foreach (sort @{$MODULECONFIG{NETWORK}}) { (my $item)=split /:/; my $DB_FILE="./rrd/$item.rrd"; my $COLOR=$COLORS[$COLOR_NUM%$#COLORS]; $COLOR_NUM++; push @COMMANDS,"DEF:ip_$item=$DB_FILE:$dev:AVERAGE"; if ($FIRST eq "true") { push @COMMANDS,"AREA:ip_$item$COLOR:$item"; $FIRST="false"; } else { push @COMMANDS,"STACK:ip_$item$COLOR:$item"; } } push @COMMANDS,HotSaNICdiagram::insert_lines(%MODULECONFIG); my %CONF=(RANGE=>$descr,FILENAME=>"$OUTDIR/$name-$file",FORMAT=>$IMGFMT,INTERVAL=>$build,FORCE=>$FORCE,OPTIONS=>[@OPTIONS,@EXTOPTIONS,@COMMANDS],DEBUGLEVEL=>$DEBUGLEVEL,MODNAME=>$MODNAME); HotSaNICdiagram::graph(%CONF); } print "\n"; } else { print " No database found\n Please check if the daemon is running.\n\n" } } exit 0; WebSVN - hotsanic - Blame - Rev 25 - /branches/HotSaNIC-0.5.0-pre6/modules/dnet/diagrams.pl
  jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [dnet/] [diagrams.pl] - Blame information for rev 25

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1