#!/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 9 - /trunk/modules/routing2/read-data.pl
Català-Valencià - Catalan
Česky - Cesky
Dansk - Dansk
Dutch - Dutch
English - English
Finnish - Finnish
Français - Francais
Deutsch - German
עברית - Hebrew
Magyar - Hungarian
Bahasa Indonesia - Indonesian
Italiano - Italian
日本語 - Japanese
한국어 - Korean
Norsk - Norwegian
Polski - Polish
Português - Portuguese
Português - Brazilian Portuguese
Русский - Russian
中文 - Simplified Chinese
Slovenčina - Slovak
Slovenčina - Slovenian
Español - Spanish
Svenska - Swedish
中文 - Traditional Chinese
Türkçe - Turkish
Oëzbekcha - Uzbek
hotsanic
Subversion Repositories:
banderdyn
centos.prosek.czf
crusader
czf4bfu
czf4bfu.prosek.czf
czfcentos
czfgmap
discover
fedora.prosek.czf
freenet-router
ftth
getonlineclouds
hotsanic
internet.prosek.czf
is
mapstats
meteolinger
netmap
qos
sedlo
sedlo.prosek.czf
switches
vbtobb
vlubnt
weathermap
weatherstats
websvn
wifidashboard
wifimon
www.prosek.czf
xenstats
[
/
] [
trunk/
] [
modules/
] [
routing2/
] [
read-data.pl
] - Blame information for rev
9
Line No.
Rev
Author
Line
Powered by
WebSVN
2.2.1