• HPT Stats

    From Paul Hayton@3:770/100 to All on Sat Dec 21 10:27:36 2019
    Hi guys

    Couple of questions..

    1) Does anyone have an example of the correct syntax to use to call adv-stat-hpt.pl when I am wanting to create a stats report for a given date range, say the last 24 hours. I have looked at the .pl file and can see some syntax but when I try to add it to the command line it fails. I'm picking I'm missing something simple.

    2) Is there a way to tell the script to exclude certain echo areas in it's report output?

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (3:770/100)
  • From Michael Dukelsky@2:5020/1042 to Paul Hayton on Sat Dec 21 12:15:46 2019
    Hello Paul,

    Saturday December 21 2019, Paul Hayton wrote to All:

    1) Does anyone have an example of the correct syntax to use to call adv-stat-hpt.pl when I am wanting to create a stats report for a given date range, say the last 24 hours. I have looked at the .pl file and
    can see some syntax but when I try to add it to the command line it
    fails. I'm picking I'm missing something simple.

    I don't use this script and even don't have hpt.sta binary log to see how it works. So I can only say you may use logrotate to trim the hpt.sta to the necessary time period.

    2) Is there a way to tell the script to exclude certain echo areas in
    it's report output?

    I had a look in the script and here is a quick solution. Please take into account I could not test it. So maybe it does not work. You should replace "areatag1", "areatag2", "areatag3" by the list of areatags you want to exclude.

    -+- ~/huskyproject/hpt/misc/adv-stat-hpt.pl 2018-12-02 21:40:56.227820184 +0300 +++ adv-stat-hpt.pl 2019-12-21 12:40:41.911332963 +0300
    @@ -10,6 +10,8 @@
    $INB = $OUTB = 0; # total input and output bytes
    %config_areas, @config_links; # parsed hpt config

    +@exclude_tags = ("areatag1", "areatag2", "areatag3");
    +
    # ====================================================================
    # MODIFY THE SECTION BELOW TO CUSTOMIZE REPORT
    # -->---
    @@ -149,6 +151,16 @@
    elsif ($lcmd eq 'echoarea') {
    my @s = /^\s*\S+\s+(?:"(.*?)(?<!\\)"|(\S+))/;
    my $tag = $s[0].$s[1];
    + my $skip = 0;
    + for (my $j = 0; $j < @exclude_tags; $j++)
    + {
    + if ($exclude_tags[$j] == $tag)
    + {
    + $skip = 1;
    + last;
    + }
    + }
    + next if ($skip == 1);
    $config_areas{$tag} = {uplink=>undef, links=>[]};
    s/-[Aa]\s+\S+//;
    s/-[Dd]\s+\"[^\"]+\"//;

    Michael

    ... node (at) f1042 (dot) ru
    --- GoldED+/LNX 1.1.5-b20170303
    * Origin: Moscow, Russia (2:5020/1042)
  • From Dan Richter@1:317/3 to Paul Hayton on Sat Dec 21 11:17:08 2019
    On 21 Dec 2019, Paul Hayton said the following...

    1) Does anyone have an example of the correct syntax to use to call adv-stat-hpt.pl when I am wanting to create a stats report for a given date range, say the last 24 hours. I have looked at the .pl file and can see some syntax but when I try to add it to the command line it fails.
    I'm picking I'm missing something simple.

    What I'm doing on CRBBS, is just calling the adv-stat-hpt.pl file, and piping the output to a text file. After my stat text files are generated, my log
    files get archived, so I only have 24 hours of stats.

    perl adv-stat-hpt.pl > daily.sta

    2) Is there a way to tell the script to exclude certain echo areas in
    it's report output?

    I'm sure there's a way to do it within the perl script, but what I have done, is use sed to remove any that I don't want in the report.

    sed -i '/NETMAIL/d' ./daily.sta
    sed -i '/CN_FILES/d' ./daily.sta
    sed -i '/CN_GENERAL/d' ./daily.sta

    I'm sure there's a way to do this on a Windows system, but I don't know what
    it is off-hand...


    ---

    Black Panther(RCS)
    Castle Rock BBS

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From Michael Dukelsky@2:5020/1042 to Paul Hayton on Sun Dec 22 14:58:50 2019
    Hello Paul,

    Saturday December 21 2019, Michael Dukelsky wrote to Paul Hayton:

    I had a look in the script and here is a quick solution. Please take
    into account I could not test it. So maybe it does not work.

    It doesn't work even after fixing a syntax error. It is not so simple, echos are turned out to be organised as a linked list. So a quick solution doesn't fly.

    Michael

    ... node (at) f1042 (dot) ru
    --- GoldED+/LNX 1.1.5-b20170303
    * Origin: Moscow, Russia (2:5020/1042)
  • From Paul Hayton@3:770/100 to Michael Dukelsky on Mon Dec 23 08:53:24 2019
    On 22 Dec 2019 at 03:01p, Michael Dukelsky pondered and said...

    It doesn't work even after fixing a syntax error. It is not so simple, echos are turned out to be organised as a linked list. So a quick
    solution doesn't fly.


    Thank you Michael for taking the time to have a look at this. Hmmm perhaps I won't use the script after all.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (3:770/100)
  • From Paul Hayton@3:770/100 to Dan Richter on Mon Dec 23 08:54:10 2019
    On 21 Dec 2019 at 11:10a, Dan Richter pondered and said...

    I'm sure there's a way to do this on a Windows system, but I don't know what it is off-hand...

    Thanks for the info Dan :)

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (3:770/100)