added PC92 stats to mrtg
authorDirk Koopman <djk@tobit.co.uk>
Wed, 10 Oct 2007 15:11:35 +0000 (16:11 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Wed, 10 Oct 2007 15:11:35 +0000 (16:11 +0100)
cmd/mrtg.pl
perl/DXProtHandle.pm
perl/Mrtg.pm
perl/Version.pm

index 2f6a578bb1703f9b45263ee168783f55f447f63b..4f0214e9110e91050d70fa3bf2b5146f77398f84 100644 (file)
@@ -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 <font color=#00cc00>C</font> and <font color=#0000ff>K</font> 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 <font color=#00cc00>A</font> and <font color=#0000ff>D</font> 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
 #
index eea43772deb4f06eb0826c779abbf98959257259..f7f8d0742eb8ecb3ac9090c33be3787ffe8f4c9c 100644 (file)
@@ -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;
 
index 3871a9080cd7dfde330bbe8ac5f5dab0cd37636e..c3164672df210580e32cc844a33b97466960eafc 100644 (file)
@@ -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");
index b3035d19d84ab9a43074fe1cac5ae442066a346c..99580fbbe12f2495b9119f38f880ddbd44700ab7 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '170';
+$build = '171';
 
 1;