Scripting
In systems infrastructure, it’s necessary to invest time in developing ad-hoc scripts to optimize overall operation, monitor services, or complete a migration. A deep understanding of programming languages isn’t as crucial as a comprehensive view of the architecture and its requirements. Below there are some developments for different system operation day-to-day needs.
Agnostic system administration
It is very common for Windows and Linux/Unix servers to coexist in the same infrastructure. This often results in double the work of system administration. To minimize time spent on repetitive tasks, I took advantage of the SSH server role offered by Windows Server. By developing small scripts that detect the type of target system they are connecting to, and using custom scripts (PowerShell or BASH) that run on remote machines receiving the same parameters, along with SSL certificates to secure the communication, I achieved an “agnostic” channel where the same call performs similar tasks on target servers with different operating systems:
As an example of the application of the above development, below is a flowchart created as a preliminary step to a complex migration that required editing hundreds of configuration files across all of the company’s production systems.
To test and restore each file to its original state, check its version, and identify which machines still needed modification, a single call from a personal laptop (authenticated with its SSH certificate, using a script called ctns) allowed for the editing of over 200 hosts in a 50/50 Windows/CentOS ratio. This was done repeatedly (querying, changing, and rolling back) by executing simple commands locally and receiving real-time reports on the status of each machine.