So, in 109 lines, I wrote a polling daemon in Perl that would query each lmgrd (license manager daemon) instance and determine the number of licenses in use per feature, how many licenses were available per feature, and the license expiration date. The script would store this data in shared memory space as a Perl hash. Then a companion script that was only 34 lines long could be called at any time, by any other process, to evaluate the licenses in use and each package's proximity to the license limit. This script was used to produce Nagios plug-ins that warned when licenses were close to expiration and to populate RRDs for Cacti to graph that data.
Further, I attached a Web app to the same data that allowed developers to quickly check the license status of any of dozens of tools and to see exactly who was using them so that they could ask for a license release if necessary. All of that stemmed from 144 lines of Perl, and the extended apps and plug-ins were only perhaps 300 lines combined.
Peace of mind in 100 lines
That's the kind of coding that admins should be able to summon when necessary. It's not a vocation, and it's not a clear focus of the job, but it's a substantial weapon when tackling many problems. I'm fairly certain that if all I did was write Perl, I'd go insane. Insanity may be a foregone conclusion for many who do exactly that, but while I find Perl, PHP, and even Bash scripting to be absolutely crucial to my normal working environment, I see them as scalpels, saws, and hammers, not the primary focus of my mental efforts.
To be sure, this handyman approach means you won't necessarily become a coding virtuoso in any of these languages. It's clearly important to write tight, secure code, but it's certain that heavy hitters can quickly point out better and cleaner ways to do many operations within that code. That's OK for the most part, as long as the script gets the job done without becoming its own problem.
I firmly believe the foundations of a good Windows or Linux admin start with a clear understanding of scripting and how to leverage that skill. If you limit yourself to working within the confines of code given to you, you'll find many problems seem to have no answer other than to purchase more software. Even then, that may not fully address the issue. The ability to roll your own is simply integral to the process.
This story, "Why admins should know how to code," was originally published at InfoWorld.com. Read more of Paul Venezia's The Deep End blog at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.