>> Web Development for Systems Administators
The last two blog posts here started to sound suspiciously more like web development than systems administration. Why is the IT manager making web pages? Well, for one thing, it is easier. I need to create my own tools to quickly get access to data about whether things are working as expected or I have a repetitive manual task that I know could be automated, but I don’t have access (or adequate justification) to create work for a developer. So I do it myself as I have time.
I also like instant gratification; that’s probably one reason I didn’t become a software engineer. When I was about 10 years old, I used to go into Radio Shack and write little BASIC programs to display ascii art like a blinking Christmas tree on the TRS-80 screen. I’d leave that running and come back later to see if anyone had stopped it. So when I first started working with web servers, I quickly appeciated and adopted the “edit/save/reload” workflow:
- Create a dynamically-generated web page in a scripting language like php or perl.
- Write a pseudo-code outline via comments for the task I need to do, e.g.
- connect to database
- count rows in x table; store that count somewhere
- disconnect and connect to second database
- perform some simply comparisons
- display the results
- Fill in functionality as I have time.
That’s a simple case, but the reason I do it via a web page is that I can work asynchronously. I have other things to do, but I can come back to this script and fill in the blanks later. I can verify each step of the way by simply reloading the web page. In a sense, notepad/vi or perhaps UltraEdit + Firefox (perhaps with the Webdeveloper or Firebug extension) is my Integrated Development Environment (IDE).
Another benefit of this approach is that the “code” is self-documenting. I might actually start by creating a wiki page outlining the task, then copying and pasting it into my script, filling in the blanks with real code. Usually there are discrete tasks I need to figure out–what is the command to do “x” or perhaps, more fundamentally, how can I get this perl script to connect to a Microsoft database?
Once I have a web page displaying the information I need, I can think about converting it into a command line script that can be cronned or set up as a scheduled task, or I can write a script that uses wget or curl to load the page. I could use a network monitoring application to load the page and test its contents. I could add code to the script to put the data in an Excel spreadsheet and email it to me. It all depends on how much time and motivation I have.
Subscribe by RSS






