Wifi monitoring

Commands iwconfig, grep and cut to extract the percentage of the quality of the Wifi signal

Wifi monitoring, power and wireless network range

Although since 1985 the federal government of the United States of America provided the radio bands (frequencies) to be used for our daily use, it was not until 1999 when the brand Wi-Fi® was registered, which means wireless fidelity and in that same year was founded the WECA (Wireless Ethernet Compatibility Alliance).

A bit of history

We may have surprised you when we told you that Wi-Fi® is a registered trademark, but after so many years of massive use there are many ways to write it and Wikipedia picks them all up; however, here we will write it simply as Wifi. The case that concerns us today is Wifi monitoring and as you can see we will leave links throughout the article complementing our indications.

Already in 2005, with the G standard fully established (54 million bits per second in the 2 400 000 000 hertz band), and when the first mobile phones with Wifi connectivity appeared, the word began to appear in dictionaries and since then its ubiquity has been taken for granted. For many years it was faster to connect our mobiles to our wireless networks in homes and offices (including public places such as parks and shopping malls) until the fourth generation standards (Long-Term Evolution, LTE with 4G) arrived for our mobiles, with the small detail that it is still faster and safer to access our documents, applications and data repositories in our offices or homes via Wifi to our local servers, including those of Pandora FMS.

That said, the number of wireless routers has only increased, and for this year with the explosion of the Internet of Things has come an avalanche of new devices to monitor. Now, my reader friend, you may be wondering: What do I care about the intensity of the signal, when moving around a little with my laptop/mobile/tablet/etcetera is enough? The issue goes further in business and industry with desktop computers and other “immobile” artifacts.

Specifications

We cannot start without a firm basis such as public norms, and we will expound it in such a way that it deprives simplicity over formality. As we said, the Federal Communications Commission (yes, the one we see on the labels of our electronic devices) made the 900 Mega Hertz, 2.4 Giga Hertz and 5.8 Giga Hertz frequency bands available for everyday use in 1985.

Wifi monitoring

Federal Communications Commission (FCC) Logo

It is easier to represent them with multiple prefixes (kilo for thousands, mega for millions and giga for billions) than as we placed it at the beginning of the article with a large number of zeros. We did it in a totally didactic way; a Hertz (named after Heinrich Rudolf Hertz, German physicist) indicates the number of repetitions per second of a given physical phenomenon. For electronic devices this concept is used to keep track of the clock that becomes the necessary and indispensable heart for the whole digital world we know to work. These watches are made of quartz and generally vibrate at 32 Kilo Hertz at room temperature, but at extreme temperatures they can accelerate their operation and even stop completely in very particular working conditions as happens with the iPhone® in the presence of helium gas.

In the case of frequency bands, the higher the amount of data to be transmitted, the higher the energy consumption. However, the use of ingenious coding algorithms allows data to be multiplexed and increases efficiency:

  • In 2000, the 802.11b standard transmitted at eleven million bits per second (11 Mbps) at 2.4 GHz.
  • Year 2002 the 802.11a standard transmits at 54 Mbps at 5 GHz.
  • In 2003 the 802.11g standard transmits at 54 Mbps at 2.4 GHz: this is still the most widely used standard, as many new models of routers bring compatibility.
  • In 2006 the 802.11n standard had a theoretical maximum of 600 Mbps at 2.4 GHz and 5 GHz.

As we explained in a previous article the rules have been advancing, always at higher speed. Remember the clock speed? Well, now the routers have grown in complexity requiring even multi-core processors and fantastic cycles – they’re all complete computers now!

These frequency bands were then divided into channels, MHz or GHz values preset so that each router can transmit without disturbing or interfering with other nearby routers. Unfortunately there are still routers that do not change channel automatically, or in the case of companies the tanks have movement of machinery and trucks that interfere with the signal, among other environmental factors that can affect the power and quality of the Wifi signal.

Wifi Monitoring

With all these good news of higher frequencies and better technologies we can never forget that all this infrastructure is just a section of the network topology and its monitoring. What happens is that we must now collect a new set of data that we will then turn into information. There is a lot of software that can inform the user directly about their WiFi connection, such as NetSpot, WiFi Analyzer, inSSIDer and many more. In our case, the workhorses are Unix or Linux systems and for them one of the software that allows us to see in a “graphic way” through a terminal is wavemon, written by Jan Morgenstern in 2009 and maintained by Gerrit Renker since then. It is found in the Debian and derivative repositories, as well as for CentOS: in the first case we will install it with apt install wavemon and in the second case with yum install wavemon (for any other distribution we will be able to compile by downloading its source code). The only thing left to do is to execute it and press the F8 key for help, which only consists of the advice “don’t panic“, which we still laugh at (geek humour is somewhat difficult to understand and appreciate) and with the F9 key the familiar “About” window.

Wifi monitoring

wavemon: help and window “about”

With the F3 key you can display, for example, the channel and frequency to which the wireless network card is connected, as well as other important values such as the MAC address of the router, for example:

Wifi monitoring

wavemon informs about wireless router: SSD, MAC address, signal strength, channel, frequency and connection type

Pandora FMS: Modules and plugins

Pandora FMS works on the basis of modules and plugins, which are very well explained in an excellent article published by one of our writing colleagues. The problem is that wavemon does not deliver this type of values by standard input, but instead we can use a much simpler command called iwconfig which is part of the wireless-tools maintained by Jean Tourrilhes. Although its main function is to set configurations and connection parameters, we will only use the query options, i.e. read-only values.

banner full pandora fms free demo
banner tablet pandora fms free demo
banner mobile pandora fms free demo

With iwconfig we will obtain the summarized data of each one of our network cards, either real or virtual. In case of not obtaining a wireless connection in the network connection, it will show the message “no wireless extensions“; for it we will have to filter the result, since we are not interested in the error outputs or STDERR:

iwconfig 2>/dev/null

Once we have identified the card that does have wireless connection capabilities we can make your Wifi Monitoring. Our concrete example has the name wlp4s1 :

Wifi monitoring

Commands iwconfig, grep and cut to extract the ESSID

For the ESSID and Access Point we will use in Pandora FMS a “Generic string” to store these text strings and we will place an alert if they change, because they should not vary, we work with devices that must always be connected to the same routers. In the case of the quality of the signal we will use a “Generic numeric” taking into account that from the two numerical values we obtain a percentage.

Wifi monitoring

Commands iwconfig, grep and cut to extract the MAC ADDRESS

Wifi monitoring

Commands iwconfig, grep and cut to extract the percentage of the quality of the Wifi signal

SNMP monitoring

So, we must combine the information gathered here with the information we collect from wireless routers via SNMP, which we explain in more detail in this entry.

However, due to the large number of manufacturers, this area belongs in depth to the Enterprise version. Please contact us if your hardware has specialized OID’s. Thank you for reading!

Shares