From: Dirk Koopman Date: Wed, 10 Oct 2007 15:11:35 +0000 (+0100) Subject: added PC92 stats to mrtg X-Git-Tag: 1.55~44 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=c32170b5b05416143021fb165a27072ce861350b added PC92 stats to mrtg --- diff --git a/cmd/mrtg.pl b/cmd/mrtg.pl index 2f6a578b..4f0214e9 100644 --- a/cmd/mrtg.pl +++ b/cmd/mrtg.pl @@ -13,6 +13,7 @@ # hfvhf - all spots split into HF and VHF # wwv - two graphs of WWV, one SFI and R other A and K # wcy - WCY A and K +# pc92 - PC92 C and K, PC92 A and D # all - all of the above # # b) actions @@ -139,6 +140,22 @@ if ($want{wcy} || $want{all}) { $mc->data('wcyka', $WCY::a, $WCY::k, 'WCY A and K') unless $want{cfgonly}; } +if ($want{pc92} || $want{all}) { + + $mc->cfgprint('pc92ck', [], 1024000, + "PC92 C and K records into $main::mycall", + 'Bytes / Sec', 'C', 'K') unless $want{dataonly}; + $mc->data('pc92ck', $DXProt::pc92Cin, $DXProt::pc92Kin, "PC92 C and K into $main::mycall") unless $want{cfgonly}; +# $DXProt::pc92C = $DXProt::pc92K = 0; + + $mc->cfgprint('pc92ad', [], 1024000, + "PC92 A and D records into $main::mycall", + 'Bytes / Sec', 'A', 'D') unless $want{dataonly}; + $mc->data('pc92ad', $DXProt::pc92Ain, $DXProt::pc92Din, "PC92 A and D into $main::mycall") unless $want{cfgonly}; +# $DXProt::pc92A = $DXProt::pc92D = 0; + +} + # # do the mrtg thing # diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index eea43772..f7f8d074 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -45,6 +45,7 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim $allowzero $decode_dk0wcy $send_opernam @checklist $eph_pc15_restime $pc9x_past_age $pc9x_future_age $pc10_dupe_age $pc92_slug_changes $last_pc92_slug + $pc92Ain $pc92Cin $pc92Din $pc92Kin ); $pc9x_past_age = 62*60; # maximum age in the past of a px9x (a config record might be the only @@ -1651,6 +1652,8 @@ sub handle_92 } } elsif ($sort eq 'K') { + $pc92Kin += length $line if $sort eq 'K'; + # remember the last channel we arrived on $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call; @@ -1668,6 +1671,10 @@ sub handle_92 } } elsif ($sort eq 'A' || $sort eq 'D' || $sort eq 'C') { + $pc92Ain += length $line if $sort eq 'A'; + $pc92Cin += length $line if $sort eq 'C'; + $pc92Din += length $line if $sort eq 'D'; + # remember the last channel we arrived on $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call; diff --git a/perl/Mrtg.pm b/perl/Mrtg.pm index 3871a908..c3164672 100644 --- a/perl/Mrtg.pm +++ b/perl/Mrtg.pm @@ -54,6 +54,8 @@ sub data { my ($self, $name, $vali, $valo, $title) = @_; my $uptime = main::uptime(); + $vali ||= 0; + $valo ||= 0; if (my $m = new IO::File ">$self->{dir}/$name" ) { $m->print("$vali\n$valo\n$uptime\n$title\n"); diff --git a/perl/Version.pm b/perl/Version.pm index b3035d19..99580fbb 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '170'; +$build = '171'; 1;