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)