Pro and Con: The case for Scripting

RSS

Pro and Con: The case for Scripting

Story by Mike James, 30-06-2009, 0 comment

Scripting rules. Of course you should be in favour of scripting; it has the power to free you from an unbelievable amount of drudgery and tedium.

It's true that scripting is also undeniably powerful and so potentially very dangerous, but this just means it has to be controlled.

Scripting gives you the power to automate any task. To be able to write a script you basically need to learn how to program - and this is true no matter what enthusiasts and introductory books might tell you in an effort to get you started.

Scripting is real programming and as such simply acquiring the skill is a mind altering experience and so worth doing. If you can program you have demonstrated your ability to think clearly, precisely, and some would say logically.

Not everyone seems to have the necessary brain wiring for the job; so don’t be too disheartened if you find it difficult, perhaps even too difficult. It is an exclusive club.

Once you know how to construct a script you can start reaping the benefits. If there is a job you do on a regular basis, or a task that you have always thought would simply take too long, then these are potential targets for a script.

You can write a one-off script to make a network-wide change and simply throw the script away when you are finished. Such one-off scripts are not usually discussed or considered when evaluating the usefulness of scripting in general. Most of the criticisms of a scripting approach to network management point out that scripts tend to be under-documented, under-developed and not transferable to other users. However, given that the vast majority of scripts are private to the person who created them, these issues don’t really apply.

If, on the other hand, you feel the temptation to make your script available to a wider audience then you need to consider all of the principles of good software design and development which is a very different undertaking. The usual rule is that you shouldn't try to use scripting to solve other people's problems unless they are extremely simple or extremely transient.

Core day-to-day network monitoring and management needs to be implanted as part of the permanent and professional infrastructure - not as a script that you cooked up in a few minutes.

Of course, even personal ad-hoc scripts can be a problem. That script that you wrote to delete a few rogue files could just delete everything on the hard disk if you get it wrong! However, this is just the continuation of the responsibility not to do anything damaging to the system that all administrators have. For example, you can delete large chunks of data with a single click or SQL command - but you just have to be careful not to do it.
 
This is perhaps where it is appropriate to point out that scripters haven't been particularly well served in terms of tools to make scripting easy and safe. There are few development environments for scripts that make the task as easy as developing a C# program in Visual Studio, say, and there are even fewer facilities that make it possible to adequately test a script in a controlled environment before letting it loose on the real system.

Equally, the quality of documentation is poor especially when you consider the ancillary technologies such as WMI or any of the operating system APIs that make scripts so powerful. Again these are the conditions a scripter has to simply live with but they do make the task far more difficult than it needs to be - and this is regrettable.

So is scripting evil? Not if it is used in the right way:

Learn to script - it’s a good education and great for the brain, so much better than a crossword or a sudoku.

Don't write scripts for other people to use or to be incorporated in any way to the permanent infrastructure of the system.

Always regard scripts as disposable. If you do find a script that elevates itself to being indispensable then get it converted into a professionally finished utility complete with documentation.

Treat any new script with care and suspicion - it could be just about to bring the system down with a single bound…. (but then you could do that anyway without a script).

If you follow these simple guidelines and don't become overly ambitious or precious about scripting then it will all work in your favour.

Read the case against scripting: scripts are just too powerful and too uncontrolled, and human beings are too inventive


SHARE THIS.

Post new comment





500 characters left

Verification Image

SIGN UP.

Sign up to receive the latest news and updates from Server-Management via email.

News & Features Feed
Viewpoints Feed
FOLLOW US.
OUR SPONSOR.
Top 10 Most Popular Articles
Top 5 Jobs
DBA/Quality Assurance Manager - Industry Leader - Stoke
Posted:
2010-03-10
Location:
West Midlands, West Midlands
Salary range:
55000 - 60000
Salary period:
year
Description:

DBA/Quality Assurance Manager - Industry leader - Staffordshire Our well known client have an excellent opportunity for a Senior Data & Quality Manager to make a real impact in the business. The successful Data & Quality Assurance Manager will ideally have come up through the route of ... read more

IT Manager
Posted:
2010-03-10
Location:
Nottingham, Nottinghamshire
Salary range:
40000 - 45000
Salary period:
year
Description:

IT Manager Key Skill Set: .NET, C#, SQL, CSS, XHTML, XML, AJAX My client is recruiting for an IT Manager to head up an expanding .NET development team. The company are involved in the manufacturing and importing sector. The IT team is playing a vital role in the success and expansion of thi... read more

IT Security Manager- CISSP, CISM - Firewalls, IDS, NAS - £££
Posted:
2010-03-10
Location:
Kent, South East
Salary range:
45000 - 55000
Salary period:
year
Description:

Security, Access Control, Authentification, Data Security, Internet and email Security, Firewalls, IDS, NAS, RAS, Anti Virus, Pen Testing, ISO27001, CISSP, CISM Ignore all other IT Security related roles you have seen advertised in Kent and make this the first and only job you apply to in 2009 ... read more

IT Helpdesk Support Officer - MCDST - £25K - London Marylebone
Posted:
2010-03-10
Location:
West End, London
Salary range:
22000 - 25000
Salary period:
year
Description:

IT Helpdesk Support Analyst / IT Helpdesk Support Officer with an MCDST certification, experience of 1st and 2nd Line Support, ideally within an ITIL environment required by our Client, a medical organisation based on Harley Street, near London Marylebone for this immediate start. Salary to &pou... read more

IT Director - International Enterprise Systems (£90,000 to £100,000)
Posted:
2010-03-09
Location:
Middlesex, South East
Salary range:
90000 - 100000
Salary period:
year
Description:

IT Director. Based in West London. Salary of £90-£100K. Package of c£140K. Director of IT – International Enterprise Systems. IS Recruitment are looking to recruit an IT Director for their client based in the west of London. With a global presence, their products and thei... read more


Want to advertise here? Follow me!