Pushover alerts are truncated

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

natkin

New Member
Jul 14, 2016
15
1
3
Pushover alerts are limited to 1024 characters (Pushover: API), but napp-it just sends the pools status as-is. If the degraded pool is not within the first 1024 characters, the alert does not contain anything meaningful.

I wonder if it's possible to filter out pools that are ONLINE.
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
To fix this problem with a large zpool status output I will reduce the output to "pool, state and errors"

You can try if you want
add the following at line 176 after
$text=`$t`;

in file /var/web-gui/data/napp-it/zfsos/_lib/scripts/job-push.pl

Code:
        @t=();
        @t=split(/\n/,$text);    # reduce output to pool, state and errors, push max 1024 char
        @l=();
        foreach my $t (@t) {
           if ($t=~/pool: /)     {  push(@l,"$t\n"); next; }
           if ($t=~/state: /)    {  push(@l,"$t\n"); next; }
           if ($t=~/OFFLINE|DEGRADED|UNAVAIL|FAULTED|REMOVED/s) {  push(@l,"$t\n"); next; }
           if ($t=~/errors: /)   {  push(@l,"$t\n\n"); next; }
        }
        $text=join("\n",@l);
 

natkin

New Member
Jul 14, 2016
15
1
3
May I recommend to also grep lines like the following for the alert:

Code:
action: Wait for the resilver to complete.
scan: resilver in progress since Mon Mar 19 20:23:26 2018
   1.30T scanned out of 10.7T at 62.7M/s, 43h42m to go
   263G resilvered, 12.17% done
(edited: added "action:" line above)
 
Last edited: