Collectd madwifi plugin is not working

Hi Friends,

I'm trying to collect Wireless statistics from Access Point (AP) device and view the output using Kafka server. I've added 'madwifi' plugin in OpenWrt code using 'make menuconfig' (Utilities --> collectd --> collectd-mod-madwifi). After successful build, I flashed firmware image into AP to view the output. But I couldn't see the 'madwifi' i.e. Wireless statistics in Kafka server. Our WiFi LAN driver is Atheros only, so no dependency issue and able to see wireless data using other commands in AP.

I've configured 'network', 'madwifi' and 'syslog' plugins in '/etc/collectd.conf' file present in AP. Also I've configured '/etc/collectd/collectd.conf' where collectd and Kafka servers are running (Linux machine).

Just to make sure whether it is working or not, i've disabled 'Interface' plugin in AP, no interface statistics/data displayed in Kafka server. I'm able to see 'interface' statistics/data in Kafka server when enable 'Interface' plugin in AP.

I could see 'memory', 'cpu', 'interface' and 'load' plugins data when enable/add in AP collectd.conf file. But, I couldn't see 'madwif' or 'syslog' or any other plugin added newly in AP.

Could you please anyone help me to add new plugins and view the statistics in AP. I'll be very happy if you are able to help me to get 'madwifi' related data in Kafka server. (Or) Please guide me how to add any new plugins in our OpenWrt code and view the output without any issue. Thanks in Advance.

Please check my configuration below:

Linux (Kafka and Collectd servers are running)
/* /etc/collectd/collectd.conf */

#Hostname "localhost"
FQDNLookup true
#BaseDir "/var/lib/collectd"

LoadPlugin network
<Plugin network>
#       # server setup:
        <Listen "" "25826">
               Interface "eth0"
               Interface "eth1"
               Interface "wifi0"
               Interface "wifi1"
#       Listen "ff18::efc0:4a42" "25826"

LoadPlugin write_kafka
<Plugin write_kafka>
        Property "" "localhost:9092"
        <Topic "test">
                Format JSON

AP Configuration
/* /etc/collectd.conf */

BaseDir "/var/run/collectd"
#Include "/etc/collectd/conf.d"
PIDFile "/var/run/"
PluginDir "/usr/lib/collectd"
TypesDB "/usr/share/collectd/types.db"
Interval 10
ReadThreads 2

LoadPlugin rrdtool
<Plugin rrdtool>
        DataDir "/tmp/rrd"
        RRARows 100
        RRASingle true
        RRATimespan 3600
        RRATimespan 86400
        RRATimespan 604800
        RRATimespan 2678400
        RRATimespan 31622400

#LoadPlugin iwinfo
#<Plugin iwinfo>
#       IgnoreSelected false

LoadPlugin madwifi
<Plugin "madwifi">
        Interface "wlan0"
        Interface "wlan1"
        Interface "wifi0"
        Interface "wifi1"
        Source "SysFS"
        WatchSet "None"
        WatchAdd "node_octets"
        WatchAdd "node_rssi"
        WatchAdd "is_rx_acl"
        WatchAdd "is_scan_active"
        WatchAdd "ath_nodes"
        WatchAdd "is_rx_assoc_bss"
        WatchAdd "is_rx_assoc_notauth"
        WatchAdd "is_rx_assoc_capmismatch"
        WatchAdd "is_rx_assoc_norate"
        WatchAdd "is_rx_assoc_badwpaie"
        WatchAdd "ns_rx_disassoc"
        WatchAdd "is_rx_notassoc"
        WatchAdd "ns_tx_assoc"   
        WatchAdd "ns_tx_disassoc"
        WatchAdd "is_rx_disassoc" 
        WatchAdd "is_ps_unassoc"      
        IgnoreSelected false              
LoadPlugin interface                      
<Plugin interface>                     
        IgnoreSelected false           
#       Interface eth0           
#       Interface eth1           
#       Interface wifi0          
        Interface wifi1          
#       Interface ath1           
LoadPlugin network                    
<Plugin network>                          
        Server "" "25826"    
        Forward true                      
#LoadPlugin load

What else I've tried

  1. Modified collectd.conf file in source code then flashed image (no output)
  2. Added plugins separately in /etc/collectd/conf.d but no output

Is the madwifi plugin still supposed to work?
To my knowledge it was intended for the old anqique deprecate madwifi drivers that have been removed from OpenWrt several years ago. Those drivers have nothing to do with the current mac80211 based drivers like ath9k and ath10k.

Before trying to see the results in Kafka server, just look at the local filesystem in the router if the respective rrd data files are getting generated and do they contain any sensible data.

the collectd madwifi plugin has received the last actual functional changes 10 years ago in 2009. Since then the only changes upstream have been formatting/out-of-bounds etc. fixes.

1 Like

Thanks dear hnyman. I'm new to OpenWrt code development. so, no idea whether 'madwifi' plugin is supported or not. Based on your reply, I come to know that 'madwifi' plugin is not supported in the latest drivers such as ath9k and ath10k. Shall i confirm?

I've verified AP device local filesystem. Yes, you are right, no rrd files generated in my device.

root@OpenWrt:/# ls /tmp/rrd/OpenWrt/
interface-ath1/   interface-wifi0/  iwinfo-ath11/     load/
interface-eth0/   interface-wifi1/  iwinfo-ath12/
interface-eth1/   iwinfo-ath1/      iwinfo-ath13/
root@OpenWrt:/# ls /tmp/rrd/OpenWrt/

When adding new plugin to collectd daemon; is it sufficient enabling a specific plugin using 'make menuconfig' and changing configuration file 'collectd.conf'? (or) do i need to change any other code or configuration file as well?

Madwifi plugin has been disabled for the last 2.5 years in the current branches (18.06, 19.07 and master).

It is still selectable in the deprecated 17.01 branch, but will not likely work...

...unless your device is actually using the antique madwifi WiFi driver itself, which was superseded by ath5k and ath9k drivers etc. ten years ago. The last actual release of madwifi was in 2008, so I highly doubt that any recent device is using madwifi for WiFi.

1 Like

Thanks hnyman for your valuable information and time. Now we stopped trying 'madwifi' plugin to get Wireless statistics from AP. Now we are trying to get WiFi related statistics using 'exec' plugin in collectd. I'm trying to write shell script which collect wifi statistics using existing commands and configuring 'exec' plugin in collectd.conf file. Please provide your valuable input, if you have any idea about collectd 'exec' plugin. Thanks.

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