[collectd] Wireless plugin patch for collectd 3.11.5

Florian Forster octo at verplant.org
Fri Aug 31 17:19:58 CEST 2007

Hi Silvio,

On Tue, Aug 28, 2007 at 10:43:16AM +0200, Silvio Klaic wrote:
> If you don't receive it let me know, I place it on my web page then.

I received it okay, thank you :) I have a few questions regarding your
code though..

I don't understand your functions `ConvertSignalQualityToRssi' and
`ConvertRssiToSignalQuality' though. They each use two linear functions
to convert from signal strength to a quality value and back again. Which
one is used depends on the signal strength - but they don't even have
different gradients..

Why don't you simply use (100 * (current - min) / (max - min))?

Besides, why even convert to some quality indicator? _The_ unit for
signal strength is dBm (or Dezibel or Bel, chose your poison), so I
think we should record values in exactly that format.

I can see that converting the ``quality'' returned by a card to dBm may
be messy and inaccurate, so recording a percentage for these cards would
be fine for me. I'd prefer to convert them to dBm though.

Please keep in mind that this is only the storage format. If someone is
uncomfortable with a logarithmic scale you can always use RRDTools `RPN'
feature (or OO.o what whatever with the CSV files) to convert the values
for a presentation. (Basically the same applies to temperatures, though
we're using Celsius there - not Kelvin ;)

That being said, you further use the following to decide if the card
returns a ``quality'' or dBm values:
-- 8< --
  if (power <= 100) { /* cards returning percent values, test with power
			 because noise in dBm can be lower than 100 */
-- >8 --
I always thought (and your code indicates) that the power of wireless
LAN equipment is well below 0dBm, i. e. in the general range of -100 to
-50 dBm..? I would have thought that this decision should be done as
-- 8< --
  if (power < 0) /* card returns dBm */
  else if (power <= 100) /* card returns percentage */
  else /* whatever that means */
    ERROR ("Your WLAN-card is too strong for me!");
    return (-1);
-- >8 --

And one last question: In your code there's
-- 8< --
  power -= 256.0;
  noise -= 256.0;
-- >8 --
Where do these shifts come from? If that's some Linux specific stuff,
could you please provide a pointer to some documentation or code
segments? Thanks ;)

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20070831/335296df/attachment.pgp 

More information about the collectd mailing list