
Do you know the "no Internet" situation?
Usually an attempt at correction involves:
- bypassing family members (well, yes, I’m shaking the new season of Dr. House. And who might be disturbed by this?)
- reboot the router (well, I’m stuck, I’m stuck - for days, you shake all sorts of rubbish ..)
- Do not download updates (good news - new Acrobat Reader ...)
- if we have fleas (our botnet today was given a great homework)
- call provider (our channel works like a clock from the company's inception)
- uh maybe another router?
...
Everything will turn out if your router supports the
SNMP protocol - a special protocol for telemetry of network devices and applications. We understand the instructions to the router or web interface, do you have support for SNMP. In some cases, it appears when installing unofficial firmware. We are looking for it in the web interface, turn it on. We remember the name of the community name - this is the password by which the SNMP readings of your router are available on the network (the default is usually public).
')
Fig. 1. Everything is simple. Either there is SNMP support, or there is none.In order not to lose a lot of time for nothing, let's do an express check. Download the
NET-SNMP library. From the bin directory, execute the command:
snmpstatus -c public -v 1 192.168.1.1
public - password for accessing SNMP (community name)
192.168.1.1 - router ip address
If the router responded with a summary of information about itself (OS, uptime, ...), go ahead.
Open Source Monitoring Solutions:
I will disassemble the use of MRTG. Not the best usability, but the easiest installation. We do not yet need to monitor thousands of devices. MRTG is a set of scripts that will generate html pages and png images with statistics on the parameters that you monitor.
Install MRTG. The site has a detailed installation guide for UNIX and Windows. Perl is required for Windows. The most common free PERL distribution for Windows is
ActivePerl . I did not see a separate manual for the Mac, but since MRTG is nothing more than a PERL program, it should work too.
A short way to start monitoring traffic on the router's network interfaces is to create the MRTG configuration file with the cfgmaker command. For example, my ASUS WL-500g premium router has 8 network interfaces, and this allows you to see traffic from the provider, from the WiFi device (phone and laptop), from the workstation through Ethernet
Fig. 2. From the comparison of graphs on different interfaces, you can see where the traffic comes from.Slightly more difficult to monitor the load and memory usage. You need to have a MIB device specification. If SNMP is officially supported, then it is most likely available on the manufacturer’s website. If this is an unofficial firmware, then perhaps the community has already had some groundwork that has made the firmware. For example, the specification for ASUS WL-500g is
here . In my case, the OID for the average 5 minutes load on the CPU .1.3.6.1.4.1.2021.10.1.5.2 used by the RAM .1.3.6.1.4.1.2021.4.6.0. When describing the CPU readings and memory usage in the MRTG config, you need to specify using the gauge option that these are current readings, not an integral value, as for traffic, when SNMP transmits the number of bytes passed through the interface since the device was turned on (well, or reset the counter, if you work long)
Fig. 3. Usually the CPU load is at zero. It grows when several processes are pumped at high speed. Used memory is changing slightly.Of course, you don't need to run mrtg every 5 minutes manually, but you need to create a cron task (Unix) example:
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
If you put mrtg from the package, the task will be added by itself.
or Sheduled Tasks (Windows) Example:
Run: wperl mrtg --logging=eventlog mrtg.cfg
Start in: c:\httpd\htdocs\mrtg\bin
Perhaps, the capabilities of your router are much wider, and you can get much more information - MAC addresses of clients, traffic to MAC addresses, and so on. May Google help you!
PS This note, of course, is not focused on network infrastructure specialists. I just accidentally discovered the SNMP bukavy and I am sure that I am not alone in this. Perhaps this will help someone when choosing a new router.
In the comments I discovered the
DD-WRT super
firmware . Now I think ...