Monitoring and scripting

IT administrators and scripting

With scripting you can easily automate simple and repeatable tasks. For IT management (monitoring) scripts are frequently used. This creates a powerful platform for automating tasks. Scripts are mainly used because they simplify the management of business processes and improve IT performance. This means scripts are used everywhere in a typical corporate IT environment.

Dangers of scripting

However, scripting was never intended as a replacement for application programming. Managers are often horrified when they discover how many scripts are used for the successful operation of their IT infrastructure. But they usually only discover this danger when the company has a crash and this is investigated. The use of scripts has various risks:
  • Error sensitivity: by modifying scripts yourself, errors may occur in the code. The most eye-catching errors are likely to be discovered quickly the first time the script has run, but less obvious errors can remain inactive for weeks, months or years and appear devastated unexpectedly.
  • Lack of support: When a (modified) script fails, there is no hotline to call, no support agreement and only you are responsible. If an incorrectly coded script unintentionally deletes data, crashes systems or otherwise damages a production environment, the costs and responsibility are for yourself.
  • Loss of important knowledge: Custom scripts are usually created and managed by a single administrator. If that individual changes roles or worse, leaves the company completely, the script will not be managed until it breaks or needs to be revised. In the best case this is time consuming. However, most of the time scripts are extremely complicated and not well documented, the encoding of the code can take a long time, while the services remain low and manual processes have to be performed to maintain the affected operations.
  • Changes in the environment: Administrators write scripts to work on the environment that exists at the time of their development. However, the reality is that IT environments are constantly changing, with files and applications often being moved, configuration settings being periodically changed and software components being constantly patched and updated.
  • Growing number of scripts: A frequent use of scripts results in a complex structure that can seriously cause business problems. This creates a chaos of active scripts, inactive scripts, relevant, non-relevant and forgotten scripts and even scripts that refer to scripts. This makes the IT environment uncontrollable and makes it difficult to quickly identify and resolve the cause of critical problems.

    @echo off
setlocal EnableDelayedExpansion
Set _sitename=%1
Set _sitename=%_sitename:”=%
for /f “tokens=*” %%i in (‘C:\Windows\System32\inetsrv\appcmd list sites /text:name /state:started’) do (
IF [“%%i”] == [“%_sitename%”] (
echo OK
exit 0
)
)
echo Site not running: %_sitename%
exit 2

Benefits of scripting

But despite the dangers of scripting, it still remains a quick and easy resource for performing simple and repeatable tasks. Simple, well-documented and easily managed scripts can be important for automating processes. This also includes scripts / plugins, which are supplied by the hardware supplier itself. Well tested and specially developed to monitor this hardware, this can deliver great added value.

 

Monitoring tool and scripting

Scripts can never replace a good monitoring tool. After all, with a monitoring solution you already have a powerful tool to perform simple and repetitive tasks, made to monitor a complex IT environment. However, if you still have a need for specific scripts, make sure that you take into account the dangers of scripting. This can be done by thoroughly testing, cataloging and carefully maintaining scripts, making authors responsible for any breaches of the protocol and keeping a close eye on the size and number of scripts in the company.

 

TSMS and scripting

TSMS users regularly have specific monitoring questions, such as:
  • deadlocks in databases
  • monitoring of manufactured specific hardware
  • app pools in IIS serverWith scripts these can be easily monitored. Because scripts give feedback in a standardized way, the “Third Party Connector” module has been built in TSMS. With this you can add scripts / plugins to TSMS and depending on the feedback you will be alerted or informed that the danger has passed.

Read more about TP connector

error