vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

DN\UP Rate not working #74

Closed GabyPCgeeK closed 3 years ago

GabyPCgeeK commented 3 years ago

DD-WRT version 46220

After looking around a little I found that "iptables -L BWMON -vnx" returns something like

Chain BWMON (1 references)
    pkts      bytes target     prot opt in     out     source               destination
      36    17987 RETURN     all  --  *      *       192.168.1.142        0.0.0.0/0
      32    12340 RETURN     all  --  *      *       0.0.0.0/0            192.168.1.142
       1       64 RETURN     all  --  *      *       192.168.1.64         0.0.0.0/0
       1      122 RETURN     all  --  *      *       0.0.0.0/0            192.168.1.64
    2334   228175 RETURN     all  --  *      *       192.168.1.128        0.0.0.0/0
   11167 14929486 RETURN     all  --  *      *       0.0.0.0/0            192.168.1.128
       0        0 RETURN     all  --  *      *       192.168.1.34         0.0.0.0/0
       0        0 RETURN     all  --  *      *       0.0.0.0/0            192.168.1.34

the regex in bwmon.js let regex = /^[\s]+\d+[\s]+(\d+)[\s]+\w+\s+\d+\s+[a-zA-z0-9-]+\s+\S+\s+\S+\s+([0-9./]+)\s+([0-9./]+)/gm; expects digits instead of the all in the prot column. Changed it to

let regex = /^[\s]+\d+[\s]+(\d+)[\s]+\w+\s+\S+\s+[a-zA-z0-9-]+\s+\S+\s+\S+\s+([0-9./]+)\s+([0-9./]+)/gm;
                                            ^ from \d to \S

and now it works.

vortex-5 commented 3 years ago

You are correct it appears this has changed in the newer versions and I'm currently not running in lighttpd mode so I missed this. I'll incorporate your changes in the next bugfix version.

vortex-5 commented 3 years ago

Version 3.2.2 ready for testing. (with your changes)