Hello everyone, my name is Sergey Emelianchik. I am the head of the Audit-Telecom company, the main developer and author of the Veliam system. I decided to write an article about how my friend and I created an outsourcing company, wrote software for ourselves and subsequently began distributing it to everyone using the SaaS system. About how I categorically did not believe that this was possible. The article will contain not only a story, but also technical details of how the Veliam product was created. Including some pieces of source code. I will tell you about what mistakes were made and how they were corrected later. There were doubts whether to publish such an article. But I thought it would be better to do it, get feedback and improve, than not to publish the article and think about what would happen if…
Background
I worked in one company as an IT employee. The company was very large with an extensive network structure. I will not dwell on my official duties, I will only say that they definitely did not include the development of anything.
We had monitoring, but purely out of academic interest I wanted to try to write my simplest. The idea was this: I wanted it to be on the web, so that it would be easy without installing any clients to go in and see what is happening to the network from any device, including a mobile device via Wi-Fi, and I also really wanted to quickly understand in which room the equipment is located that is “moping”, because there were very strict requirements for the response time to such problems. As a result, a plan was born in my head to write a simple web page with a jpeg background with a network diagram, cut out the devices themselves with their IP addresses in this picture, and show dynamic content in the form of a green or flashing red IP address on top of the picture in the right coordinates. The task has been set, we are getting started.
Previously, I was programming in Delphi, PHP, JS and very superficially C++. I know the work of networks pretty well. VLAN, Routing (OSPF, EIGRP, BGP), NAT. This was enough to write a prototype of primitive monitoring yourself.
I wrote my plan in PHP. The Apache and PHP server was on Windows because Linux for me at that moment was something incomprehensible and very complicated, as it turned out later, I was very wrong and in many places Linux is much simpler than Windows, but this is a separate topic and we all know how many holivars on this topic. The Windows task scheduler pulled with a small interval (I don’t remember exactly, but something like once every three seconds) a PHP script that interrogated all objects with a banal ping and saved the state to a file.
system(“ping -n 3 -w 100 {$ip_address}“);
Yes, working with the database at that moment was also not mastered for me. I didn’t know that it was possible to parallel processes, and passing through all nodes of the network took a long time, because it happened in one thread. Especially problems arose when several nodes were unavailable, because each of them delayed the script for 300 ms. On the client side, there was a simple looped function that downloaded updated information from the Ajax server with a request at intervals of several seconds and updated the interface. And then after 3 unsuccessful pings in a row, if a web page with monitoring was opened on the computer, a cheerful composition was playing.
When everything turned out, I was very inspired by the result and thought that I could screw it there again (due to my knowledge and capabilities). But I have always disliked systems with a million graphs, which I then considered, and still consider to be unnecessary in most cases. I wanted to screw in there only what would really help me in my work. This principle remains to this day as fundamental in the development of Veliam. Further, I realized that it would be very cool if I didn’t have to keep monitoring open and know about the problems, and when it happened, then open the page and see where this problematic network node is located and what to do with it next. Somehow I didn’t read my e-mail then, I simply didn’t use it. I came across on the Internet that there are SMS gateways to which you can send a GET or POST request, and they will send me an SMS to my mobile phone with the text that I will write. I immediately realized that I really wanted this. And began to study the documentation. After a while, I succeeded, and now I was receiving SMS messages about problems on the network to my mobile phone with the name of the “fallen object”. Although the system was primitive, it was written by myself, and the most important thing that motivated me to develop it at that time was that it was an application program that really helps me in my work.
And then the day came when one of the Internet channels fell at work, and my monitoring did not let me know about it in any way. Since Google DNS has been pinged perfectly so far. It’s time to think about how you can monitor that the communication channel is alive. There were different ideas on how to do it. I didn’t have access to all the equipment. I had to figure out how to understand which of the channels is alive, but without being able to watch it in any way on the network equipment itself. Then a colleague came up with the idea that it is possible that the route tracing to public servers may differ depending on which communication channel is currently connected to the Internet. I checked, and it turned out that way. There were different routes when tracing.
system(“tracert -d -w 500 8.8.8.8”);