#!/usr/bin/perl -w use lib "../../lib"; use HotSaNIC; use RRDs; #use DBI; # get cmdline arguments (i.e. options passed by the daemon) # and other global parameters # %ARGS=arg2opt(@ARGV); dupe_control("start",$ARGS{"MODNAME"},""); # read module-specific settings # open (FILE,"settings"); while () { ($var,$value)=parse_line($_); if ($var eq "ALL") {$ALL=$value;} if ($var eq "ROUTERS") {$ROUTERS=$value;} if ($var eq "CLOUD") {$CLOUD=$value;} if ($var eq "DEFAULT") {$DEFAULT=$value;} if ($var eq "IFACE") { ($iface)=split(/,/,$value); push @IFACES,$iface; next; } } close(FILE); foreach $iface (@IFACES) { if ( ! -e "rrd/$iface.rrd" ) { system("./makerrd","$iface", "U") } system("$ALL > $iface.all"); system("$ROUTERS > $iface.routers"); system("$CLOUD > $iface.cloud"); system("$DEFAULT > $iface.default"); system("wget -q http://localhost/cgi-bin/ospfd_database.cgi -O - | grep -c \"Advertising Router\" > $iface.ra"); system("wget -q http://localhost/cgi-bin/ospfd_database.cgi -O - | grep -c \"Advertising Router: 10.33\" > $iface.rb"); system("wget -q http://localhost/cgi-bin/ospfd_database.cgi -O - | grep -c \"Advertising Router: 10.32\" > $iface.rc"); system("wget -q http://localhost/cgi-bin/ospfd_database.cgi -O - | grep -c \"Advertising Router: 10.43\" > $iface.rd"); system("/sbin/ip ro ls | /bin/grep -c ^10.32 > $iface.re"); system("/sbin/ip ro ls | /bin/grep -c ^10.43 > $iface.rf"); system("/sbin/ip ro ls | /bin/grep -c \/16 > $iface.rg"); open (FILE,"$iface.all"); while() { $all=$_*1; } close(FILE); open (FILE,"$iface.routers"); while() { $routers=$_*1; } close(FILE); open (FILE,"$iface.cloud"); while() { $cloud=$_*1; } close(FILE); open (FILE,"$iface.default"); while() { $default=$_*1; } close(FILE); # Routing ra open (FILE,"$iface.ra"); while() { $ra=$_*1; } close(FILE); # Routing rb open (FILE,"$iface.rb"); while() { $rb=$_*1; } close(FILE); # Routing rc open (FILE,"$iface.rc"); while() { $rc=$_*1; } close(FILE); # Routing rd open (FILE,"$iface.rd"); while() { $rd=$_*1; } close(FILE); # Routing re open (FILE,"$iface.re"); while() { $re=$_*1; } close(FILE); # Routing rf open (FILE,"$iface.rf"); while() { $rf=$_*1; } close(FILE); # Routing rg open (FILE,"$iface.rg"); while() { $rg=$_*1; } close(FILE); $default=$default/100; $all=$all/10; # RRDs::update "rrd/$iface.rrd",time.":".$all.":".$routers.":".$cloud.":".$default.":".$ra.":".$rb.":".$rc.":".$rd.":".$re.":".$rf.":".$rg; RRDs::update "rrd/$iface.rrd",time.":".$all.":".$routers.":".$cloud.":".$default.":".$ra.":".$rb.":".$rc.":".$rd.":".$re.":".$rf.":".$rg; if ($ERROR = RRDs::error) { dupe_control("warn",$ARGS{"MODNAME"},"unable to update `$iface.rrd': $ERROR"); } } WebSVN - hotsanic - Blame - Rev 36 - /branches/HotSaNIC-0.5.0-jablonecka/modules/routing2/read-data.pl
  jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-jablonecka/] [modules/] [routing2/] [read-data.pl] - Blame information for rev 36

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1