Bandwidth Monitoring module doesn't work in Debian 12

SYSTEM INFORMATION
OS type and version Debain 12
Webmin version Latest
Virtualmin version Latest

@Joe I cant see any logs in bandwidth monitoring module. But /var/log/bandwidth has the Network Logs. I waited for like 12 hours and still no log in bandwidth monitoring module but logs are coming in /var/log/bandwidth that was created by the module. Is it some kind of bug or its just happening with me. Same thing happening on my all 3 VPS But Bandwidth Monitoring In Virtualmin Section is working perfectly, I can see bandwidth usages of all my virtual servers but same module in webmin section is not working.

Thankyou

@Joe @Ilia UPDATE: In ubuntu server 22.04 and Debain 11 its working perfectly but not working in debain 12. I have rsyslog installed in debain 12.

In ubuntu server 22.04 and Debain 11 its working perfectly but not working in debain 12.

This is expected because the kernel output has slightly changed. We will fix that. It isn’t a big deal.

I don’t think this is the right approach!


@Jamie in modern systems utilizing systemd , rsyslog is typically not pre-installed by default. It isn’t a problem for us though, and we don’t need to install it either. It’s overkill, as after setup_firewall_rules was run, all we need to do to get bandwidth log on systemd systems is to run:

journalctl -k --grep "BANDWIDTH_IN|BANDWIDTH_OUT"

We don’t need to setup anything else or configure anything else. journalctl is super fast, and no need for syslog or syslog-ng modules.

Example of journalctl -k command output with setup firewall rules:

Dec 12 12:12:45 host.debian12-pro.virtualmin.dev kernel: BANDWIDTH_OUT:IN= OUT=enp0s5 SRC=10.211.55.100 DST=10.211.55.2 LEN=105 TOS=0x02 PREC=0x00 TTL=64 ID=10776 DF PROTO=TCP SPT=10000 DPT=54789 WINDOW=501 RES=0x00 ACK PSH URGP=0 
Dec 12 12:12:45 host.debian12-pro.virtualmin.dev kernel: BANDWIDTH_IN:IN=enp0s5 OUT= MAC=00:1c:42:47:49:8e:92:9c:4a:db:da:64:08:00 SRC=10.211.55.2 DST=10.211.55.100 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP SPT=54789 DPT=10000 WINDOW=2050 RES=0x00 ACK URGP=0
2 Likes

Upon further consideration, there’s no need for specialized adjustments from our end regarding this issue. If you have already installed the rsyslog package and it’s running, the root of the problem on Debian 12 systems lies in the changed default date format in rsyslog itself to ISO 8601.

Unfortunately Webmin is not configured to interpret this format.

Before we implement support for utilizing journalctl to extract logs on systemd systems, and for all those who had to install rsyslog on Debian 12 for Bandwidth Monitoring module to work you would need to take a few extra steps after standard configuration is done in Webmin UI (i.e. in Bandwidth Monitoring module):

  1. Edit /etc/rsyslog.conf file
  2. Find setup by Webmin line:
    kern.=debug     -/var/log/bandwidth
    
  3. Replaces it with:
    $template WebminTraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n"
    kern.=debug     -/var/log/bandwidth;WebminTraditionalFormat
    
  4. Restart rsyslog service by running:
    systemctl restart rsyslog
    

It will make collection work as before in Debian 12.

3 Likes

Thankyou sir for solution :slight_smile:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.