To begin with, I work as a system administrator and is a bit far from programming, but I often write all sorts of scripts that facilitate everyday work. Often it is necessary to solve similar tasks on servers, for example, open a port for an ip list on all servers or check service status, check which servers are allowed to log in for a specific user, etc. The list of tasks of the same type is great, and I think that many administrators are familiar with them. ')
Attempt at writing
As soon as the number of servers exceeded the critical point, I had a question: how to manage all this and not spend a lot of time on it. It is clear that logging into the servers via RDP \ SSH and executing the same commands there is not Feng Shui. A quick analysis showed that Powershell is best suited for managing Windows servers. This was the reason for his study. To begin with, a simple script was written that allowed you to connect to Windows servers and execute scripts and commands there. In a relatively short period of time, this script was upgraded and became more or less suitable for everyday tasks. This has greatly simplified the work. However, along with this, there were difficulties: it was necessary each time to edit a text file with a list of servers in order to execute commands only on the necessary servers. It was also inconvenient to store ready-made scripts for execution. In addition, I wanted to make something universal and easy to use. Here a little PHP programming experience came in handy. The idea was simple - to tie the script to the WEB interface and make it work for you and your colleagues. Denwer was raised on a work computer and work began to boil.
After a short time, the first prototype appeared. Now it was possible to enter commands directly in the browser and list the servers "separated by commas". The result of the execution was also displayed in the browser. After a short period of time, separate functions for managing processes and services appeared. The site began to use colleagues, began to receive new ideas.
Version 2
As you understand, there was no talk about design and “usability”. It was just a set of links, input and output windows. Minimal error handling. In addition, I quickly realized that the site is not only a convenience, but also carries a threat - there was no control over the execution of commands through the site, no logs were kept (Apache logs are not taken into account). Anyone who knew the address could easily connect and execute any commands, including shutting down the servers and deleting data from them. Authorization on the site was not. At the same time, it was not necessary to know either logins or server passwords. It was enough to enter the name of the server (s) and the command, the website did the rest itself. For the sake of fairness, I must say that the site was on my working computer and there was no access from the outside, but it didn’t really warm the soul.
In this state, the site did not last long and it was decided to redo it a bit. So there was a second version of the site. Authorization via “.htaccess” was added to the menu, a list of “frequently used scripts” appeared, the first version of the “engine” appeared. Also began to appear highly specialized functions related to the specifics of the company. The site "moved" to the server, under the normal bundle of Apache \ PHP \ MySQL. Below are screenshots from the second version.
Screenshots
1. Work with services
2. Frequently used scripts
3. Run the script
Version 3
At the next stage, it became necessary to differentiate user access to different servers. For simplicity, a copy of the site with a different set of servers was raised. At that time it was enough. So the idea was to make a normal authorization with the delineation of rights. This was the impetus for the development of the third version. When writing it, all the problems and wishes that were available at that time were taken into account. As a result, the engine was upgraded, its own authorization was written, the admin section appeared (user and accessible server management), and the missing sections were added. At the moment, the site has been working on this version for more than a year and has the following features:
Work with services
Work with processes
Remote command line (the ability to save scripts)
Information: about iron, DB lists, Firewall rules
Knowledge base
Logging
Highly specialized functions
Screenshots
4. Work with services
5. Knowledge base
6. Run the script
The main disadvantage of the site is to work only with Windows servers. This is due to the fact that the overwhelming number of servers used in our company is a Windows server. Recently, the number of servers running Linux began to grow, and the question arose of how to adapt the site for them. To add support for Linux, it was necessary to rewrite the code a lot and "break" the ideology of the site, which was not what I wanted to do. In addition, there have been many attempts to find ways to execute Linux commands from under Windows in the console and somehow screw it to scripting languages. A few months later a solution was found.
Project
A year ago, I began to study frameworks and I had a final thought in my head - to make a project. The project received the name: SSC Panel - Smart Server Control Panel. At the moment, laid the foundation of the site. There is an implementation of working with both Windows and Linux servers. Implemented admin, remote command line, it is possible to save scripts, logging. So far a little, but, over time, I hope there will be more of them. The site uses the Kohana 3.3.2 engine, the commercial theme is “SmartAdmin” (not very well, I think I need to change), Powershell v3 is used for working with Windows (required on the server, the client may have v2), Linux is used for working with Linux Posh-ssh . As they say, it's better to see once:
Future plans
Develop the project and make it professional. There are a lot of ideas for implementation. What is planned in the near future: