Package: collectd
Version: 4.3.0-2
Severity: normal

I have a problem with this new plugin to monitor my wifi signal. As it
seems, signal power or noise doesn't work for me.
signal_noise.rrd and signal_power.rrd contain exactly the same values,
which correspond probbly to real signal power (around -76 dBm).

output of iwconfig wlan0 is like:
wlan0     IEEE 802.11b  ESSID:"tovar"
          Mode:Managed  Frequency:2.437 GHz  Access Point:
00:19:5B:1D:89:8C
          Bit Rate:11 Mb/s   Sensitivity=1/3
          Retry limit:20   RTS thr:off   Fragment thr:off
          Encryption key:ABC1-23CB-A1   Security mode:restricted
          Power Management:off
          Link Quality=21/70  Signal level=-76 dBm  Noise level=-98 dBm
          Rx invalid nwid:0  Rx invalid crypt:1214507  Rx invalid frag:0
          Tx excessive retries:15  Invalid misc:20574539   Missed beacon:0

My colletcd.conf looks like this:


FQDNLookup true

LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin irq
LoadPlugin load
LoadPlugin logfile
LoadPlugin memory
LoadPlugin ping
LoadPlugin processes
LoadPlugin rrdtool
LoadPlugin sensors
LoadPlugin swap
LoadPlugin wireless

<Plugin interface>
        Interface "wlan0"
        IgnoreSelected false
</Plugin>

<Plugin logfile>
        LogLevel "debug"
        File "/var/log/collectd.log"
        Timestamp true
</Plugin>

<Plugin ping>
    Host "ondra.valek.net"
    Host "lo4.bras2.prg.vol.cz"
    Host "192.168.1.1"
</Plugin>

<Plugin rrdtool>
        DataDir "/var/lib/collectd/rrd"
</Plugin> I'm happy to see this new plugin to monitor my wifi signal. But as it
seems, noise doesn't work for me.
signal_noise.rrd and signal_power.rrd contain exactly the same values,
which correspond to real signal power (around -76 dBm).

output of iwconfig wlan0 is like:
wlan0     IEEE 802.11b  ESSID:"tovar"
          Mode:Managed  Frequency:2.437 GHz  Access Point:
00:19:5B:1D:89:8C
          Bit Rate:11 Mb/s   Sensitivity=1/3
          Retry limit:20   RTS thr:off   Fragment thr:off
          Encryption key:ABC1-23CB-A1   Security mode:restricted
          Power Management:off
          Link Quality=21/70  Signal level=-76 dBm  Noise level=-98 dBm
          Rx invalid nwid:0  Rx invalid crypt:1214507  Rx invalid frag:0
          Tx excessive retries:15  Invalid misc:20574539   Missed beacon:0

My colletcd.conf looks like this:


FQDNLookup true

LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin irq
LoadPlugin load
LoadPlugin logfile
LoadPlugin memory
LoadPlugin ping
LoadPlugin processes
LoadPlugin rrdtool
LoadPlugin sensors
LoadPlugin swap
LoadPlugin wireless

<Plugin interface>
        Interface "wlan0"
        IgnoreSelected false
</Plugin>

<Plugin logfile>
        LogLevel "debug"
        File "/var/log/collectd.log"
        Timestamp true
</Plugin>

<Plugin ping>
    Host "ondra.valek.net"
    Host "lo4.bras2.prg.vol.cz"
    Host "192.168.1.1"
</Plugin>

<Plugin rrdtool>
        DataDir "/var/lib/collectd/rrd"
</Plugin> 

I've been digging through the source code and believe to have found the cause:
in /src/wireless.c between lines 125-141 (code parsing /proc/net/wireless):

/* power [dBm] < 0.0 */
power = strtod (fields[3], &endptr);
if (fields[3] == endptr)
        power = 1.0; /* invalid */
else if ((power >= 0.0) && (power <= 100.0))
        power = wireless_percent_to_power (power);
else if (power > 100.0)
        power = 1.0; /* invalid */

/* noise [dBm] < 0.0 */
noise = strtod (fields[3], &endptr);
if (fields[3] == endptr)
        noise = 1.0; /* invalid */
else if ((noise >= 0.0) && (noise <= 100.0))
        noise = wireless_percent_to_power (noise);
else if (noise > 100.0)
        noise = 1.0; /* invalid */

Both blocks of code seem to parse the same part of the line.
Unfortunately I'm not familiar with C code, compiling froum source and testing 
own debian packages, therefore I haven't 
included a real patch. Is there any howto for that?

Ondrej Valek

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.15
Locale: LANG=en_US, LC_CTYPE=cs_CZ.utf8 (charmap=UTF-8) (ignored: LC_ALL set to 
en_US.utf8)
Shell: /bin/sh linked to /bin/bash

Versions of packages collectd depends on:
ii  debconf [debconf-2.0]         1.5.19     Debian configuration management sy
ii  libc6                         2.7-6      GNU C Library: Shared libraries
ii  librrd2                       1.2.27-1   Time-series data storage and displ

Versions of packages collectd recommends:
ii  libcurl3-gnutls     7.18.0-1             Multi-protocol file transfer libra
ii  libdbus-1-3         1.1.2-1              simple interprocess messaging syst
ii  libhal1             0.5.10+git20080301-1 Hardware Abstraction Layer - share
ii  libkrb53            1.6.dfsg.3~beta1-3   MIT Kerberos runtime libraries
ii  libmysqlclient15off 5.0.51a-3            MySQL database client library
ii  liboping0           0.3.5-1              C/C++ library to generate ICMP_ECH
ii  libpcap0.8          0.9.8-2              System interface for user-level pa
ii  libperl5.8          5.8.8-12             Shared Perl library
ii  libsensors3         1:2.10.5-5           library to read temperature/voltag
ii  libsnmp15           5.4.1~dfsg-6         SNMP (Simple Network Management Pr
ii  libvirt0            0.4.0-6              library for interfacing with diffe
ii  libxenstore3.0      3.2.0-4              Xenstore communications library fo
ii  libxml2             2.6.31.dfsg-2        GNOME XML library
ii  lm-sensors          1:3.0.1-2            utilities to read temperature/volt
ii  perl                5.8.8-12             Larry Wall's Practical Extraction 
ii  rrdtool             1.2.27-1             Time-series data storage and displ

-- debconf information:
* collectd/auto-migrate-3-4: false
  collectd/migration-3-4:



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to