summaryrefslogtreecommitdiff
path: root/other/tor/bin/rrd-update
diff options
context:
space:
mode:
Diffstat (limited to 'other/tor/bin/rrd-update')
-rwxr-xr-xother/tor/bin/rrd-update21
1 files changed, 19 insertions, 2 deletions
diff --git a/other/tor/bin/rrd-update b/other/tor/bin/rrd-update
index 885eef3..7151641 100755
--- a/other/tor/bin/rrd-update
+++ b/other/tor/bin/rrd-update
@@ -19,7 +19,7 @@ sub check_exists_running($$) {
my ($rrd, $global) = @_;
return if (-e $rrd);
my @params = ($rrd);
- push @params, '-b', 'now - 12 months',
+ push @params, '-b', 'now - 24 months',
qw{ --step 3600
DS:runningVerified:GAUGE:172800:U:U
DS:runningUnverified:GAUGE:172800:U:U
@@ -50,7 +50,7 @@ sub check_exists_traffic($) {
my ($rrd) = @_;
return if (-e $rrd);
my @params = ($rrd);
- push @params, '-b', 'now - 8 months',
+ push @params, '-b', 'now - 12 months',
qw{ --step 900
DS:write:ABSOLUTE:900:U:U
DS:read:ABSOLUTE:900:U:U
@@ -120,6 +120,7 @@ for my $dir (@dirfiles) {
# running-routers moria1 moria2 peacetime metacolo ovmja....
my $dir_published = undef;
my $running_routers = undef;
+ my $router_status = undef;
my $linenr = 0;
while (<DIRECTORY>) {
$linenr++;
@@ -140,8 +141,24 @@ for my $dir (@dirfiles) {
next;
};
};
+ if (/^router-status\s*(.*?)\s*$/) {
+ if (!defined $router_status) {
+ $router_status = $1
+ } else {
+ warn ("router_status already set to '$router_status' in directory $dir, line $linenr\n");
+ next;
+ };
+ };
last if (/^\s*$/);
};
+ die ("Didn't find published for directory") unless defined $dir_published;
+ die ("Didn't find running-routers or router-status") unless (defined $running_routers or $router_status);
+
+ if (defined $router_status && !defined $running_routers) {
+ $router_status =~ s/=\S+//g;
+ $running_routers = $router_status;
+ };
+
my $current_router = undef;
my $current_platform = undef;