
I created a network monitoring system for my own needs, but over time the project has evolved to a state in which it may well be useful to other people. This article is addressed primarily to network engineers, system administrators, and other professionals whose work is related to switches and routers. If any of you want to implement FlapMyPort in your network, I am ready to provide personal assistance in its deployment, as I want people to use it.
Prehistory
As a network engineer of the trunk provider monitoring department, I have to quickly receive information about the status of our links. Even during lunch or sleep. That is why we implemented monitoring via SNMP traps. The main advantage of SNMP traps is the speed of information delivery. Instead of periodically polling device interfaces about their status, a switch or router can send a short SNMP message to a special SNMP-Receiver itself as soon as the status of one of its ports changes. It remains to generate an Email or SMS message on the side of the Receiver and send it to the user. Everything happens quickly and conveniently. However, in some cases, this approach has disadvantages.
Imagine that you have dozens of devices. Or, for example, one of the links between switches starts to flow continuously (this is not uncommon, especially when using some types of multiplexers). What will happen? In general, you will receive something similar to Email Bomb. For this reason, my colleague Pavel and I began work on a project that we called FlapMyPort.
')
What does this system do
- Receive SNMP traps
- Collects this data in the database (both for history and for instant analysis)
- Analyzes information on the go, preventing redundant notifications
- Allows you to view the history for the desired period and filter the output
- Communicates with mobile clients (more about them later)
- Generates user friendly graphics.
Key system components
Component 1: TrapHarvester
TrapHarvester is written in Python by my colleague
Pavel Polyakov . This component is responsible for receiving snmp-traps, collecting data in the database, classifying messages, and notifying users of the system (ie, administrators and engineers on duty). At the time of notification, I would like to focus your attention, because A useful feature is the absence of flooding. And this is how it works:
Imagine that two links between the Switch1 and Router1 devices have started to flow. With head-on notifications, you will receive multiple messages, like in this image:

And if 20 flaps happen, you will receive 80 letters. And this is what a mailbox looks like in a similar situation, but using TrapHarvester:
If the port continues to flop, you will receive a message like
“Two ports continue to flow onto Router1” every 15 minutes. The system has internal mechanisms of temporary “blacklist”.For our task this was an excellent result. Of course, to some extent, protection against flooding exists in existing monitoring systems, but our piece, in view of its narrow specialization, is able to analyze and classify events more subtly, sending a generalized message in an easily readable form.
Component 2: Client Applications
For even more convenience, we have created a set of applications with which you can quickly assess the current situation in the network. One quick glance is enough to determine where things fell, and how events relate to each other.
Below will be given links to download applications from the respective stores (App Store, Google Play), so you can try how it works.
FlapMyPort WEB (HTML, CSS, Angular)Web client receiving data from the API. How it works you can try right now by clicking on the link.
All the flags in the demo version are not real, they are taken from the Virtual API, about which a little later.
FlapMyPort for iPhone (Objective C)The second application that I created for this project can be downloaded from the AppStore. By default, after installation you will see all the same demo data from the Virtual API.
FlapMyPort for Mac (Objective C)Desktop application, which further enhances the convenience of monitoring. In addition, it begins to jump and make "falling" sounds when it detects a new event on the network. And from it is convenient to "copy-paste" information.
FlapMyPort for Android (Java)The kit would not be complete without an Android application, which was kindly written by my colleague Pavel. Now it is also available on Google Play.

Component 3. FlapMyPort API
The third key component is responsible for communication with client applications. In fact, it receives requests from applications, goes to the database, draws graphs and returns data in the form of a JSON response. The API is written in PHP.
Virtual APIFor the convenience of developing new customers, a copy of the API has been made publicly available. The code was slightly modified so that any Virtual API request would issue some events. Newly installed applications and the demo version of the Web application by default receive data just from the Virtual API. See the JSON that the Virtual API generates here.

Further development prospects
I think that a good idea would be to watch for errors on the port or the signal level on the optical receiver. If we compare these figures before and after any flaps, we can see a useful dynamic.
Any of your ideas will be useful to me and, perhaps, will appear in new versions of the system.
Conclusion
This project has been successfully implemented in our network. In my opinion, it turned out a useful thing, which significantly simplified the task of monitoring the status of channels. In fact, work on the project began more than a year ago, and was conducted slowly. During this time, the API has been completely rewritten, customers are honed for convenience and stability, most errors are fixed. And only recently came the idea that perhaps this project may be useful to someone else.
The last two months have been spent on bringing the system to a state where it can be shared with other people: links and passwords are transferred to the config, the code is slick and cleaned, applications are uploaded to the store, source codes are uploaded to GitHub. It turned out that preparing an application for a public release is a separate big task. The site alone took more than a week. Of course, after all this I would be pleased if one of you found this system useful for your network.
If you are interested in trying the system, do not hesitate to write me any questions, my contact details on the project website. I am always happy to help with the implementation, as well as ready to receive bug-reports and feature-requests. This will inspire me to add / improve FlapMyPort.
Of course, all the listed components are absolutely free and their sources are always available from the links below.
Thanks for attention!
Links
»
Resource site»
Step-by-step installation instructions for your networkClient applications
iOS App |
Android App |
Mac App |
WEB Online DemoSources
github.com/phylocko/FlapMyPort-WEB
github.com/phylocko/FlapMyPort-iPhone
github.com/phylocko/FlapMyPort-Mac
github.com/phylocko/FlapMyPort-API
github.com/Pavel-Polyakov/trapharvester