Deploying
First, let us run the server program, which will listen on port 7400 (you can change this in the code). Now, when all the other systems boot, they will automatically run the client program with root privileges (since we have added the client initiator script start. sh into start-up applications). As we are demonstrating the system, let the bot run in the foreground—but in real deployment scenarios, it will be run as a daemon process.
As the client executes a run, it will automatically connect to the server and wait for commands. When it receives commands, it will execute them. Figure 1 shows the server start up and issue commands (here, I named it ilinuxbot). Figure 2 shows the client receiving and executing commands. version, the ability to interact with a specific single computer is not implemented, but it can be overcome by installing and running the SSH daemon on all machines.
All commands that don’t need iterative user interaction, such as yum or reboot, can be executed successfully from this system. We will extend support to other commands and also create a GUI interface in the next article.
As this is my first article, I would also like to hear your views on it. Do send me a mail in case of any queries or suggestions. (Here, I would like to express my gratitude to Ankit Sharma for his contribution to this article.)
Keep thinking in open and odd ways—that’s what a techno-freak is meant to do. Long live FOSS…