I have a requirement where I need to display certain stats on Admin Dashboard in my web application (Angular+Java). These stats (transnational data) are being generated on different servers (connected via LAN to my web app host server) by C++ programs.
Since we don't have a centralized database we can't just store statistics into DB and retrieve it in Java services and display on UI. As a workaround I have created a shell script which SSH on different servers, collect stats and prints them on console one by one. This script can also be fired on regular intervals from my java web service.
I can parse output of script and send it to UI but this is not an efficient solution. The constant SHH after every few seconds generates lots of interrupts.
Few thoughts which initially crossed my mind are below
- Create a Java TCP Client which sends requests to different servers and get the data periodically.
- Create a Java TCP server which accepts json data from different servers.
I have never worked on something like this. Can somebody suggest a better strategy or preferably point me to online resources in order to learn and understand these sort of architectures.