Re: text output from NetworkManager ?



On Sat, 2009-10-03 at 01:49 +0200, Borge Kile Gjelsten wrote:
> Alexander Sack wrote:
> > On Fri, Oct 02, 2009 at 02:17:38PM +0200, Borge Kile Gjelsten wrote:
> >   
> >> Hi,
> >>
> >> I would like to use NetworkManager to dump info on the signal strength
> >> (32%, 47%, etc.) into a text file at e.g. every 5 seconds, or some similar
> >> approach which would help me test the wireless network at various
> >> positions in a big office landscape.
> >> I thought this might be doable from a terminal, but have found no way
> >> so far.
> >>
> >> In principle I can of course get this information by moving the cursor
> >> over the NetworkManager icon on my panel and read by eye.
> >> This is however somewhat impractical.
> >>
> >> If what I seek is not possible with NetworkManager, is there some other
> >> tool which allows me to monitor a wireless signal as a function of time?
> >>
> >> (I am using Ubuntu 9.04.)
> >>     
> >
> >
> > You could use dbus directly, but if you want this only for your own
> > use  processing nm-tool output sounds easier. I don't think that
> > nm-tool output changed from 0.7.x to 0.8, so this seems to get the
> > strength of the current active AP(s) for me:
> >
> >   nm-tool | grep ^.*\ \\* | sed -e 's/.*Strength \([0-9]*\).*$/\1/'
> >
> > .. of course, that's nothing you should put into real software; use
> > dbus for that :)
> >
> >  - Alexander
> >
> >   
> 
> Thanks, nm-tool does nearly all that I want.
> However, only the active AP is updated on every issue of the command.
> The other APs are updated every second minute only.
> I wonder if there is some way to get also these updated
> on every issue of the command.

You can only get constant signal strength updates for the current AP, or
other APs on the same channel as the current AP.  That's just how wifi
works.

To get constant updates for all APs, you'd need to continuously scan,
which is a long-running operation (2 - 15 seconds depending on the card
and type of scan) and interrupts current connections completely.  Which
is why NetworkManager doesn't scan all the time; it scans periodically
instead for these exact reasons.

What you probably want to do is 'iwlist wlan0 scan' in a tight loop with
some sed magic.  That will, of course, preclude you from using the wifi
card for any actual connection to an AP though.

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]