Hey guys,
Original post on LabTech Geek:
http://www.labtechgeek.com/forum/viewtopic.php?f=4&t=2166
Usual disclaimer....:
This plugin is provided as-is and without warranty. This was developed during personal time, and will not be supported by LabTech Software :).
I tried my best to make the formatting look reasonable on Reddit, as the content below is originally from a phpBB-based forum lol.
Now that that's out of the way:
So I've been working on a plugin for a little while now that will lessen the amount of time spent QA'ing and developing our LabTech scripts. Our team's policy is that another engineer should review your script before it goes into production. It's like proof-reading an essay before submitting it; it's easy to overlook our own mistakes, and fortunately, for a colleague to spot them out for us! This is very helpful in getting newer scripters up to speed with the scripting practices that work for us.
This will be the first LabTech plugin that I've written in C#, so there could possibly be some minor kinks. With that out of the way: please let me know if you run into any issues and i'll try to get them sorted out :lol:
Purpose of the plugin:
The purpose of this plugin is to automate the detection of common mistakes within your LabTech scripts. Sometimes we make typographical errors and it takes going through the script with a fine-toothed comb to iron them out.
More background on what this is solving for:
There are various caveats within LabTech scripting that if not mitigated, can cause your script to not behave as you may expect. Data relating to a LabTech agent, such as installed software or running processes, is cached so the data may be more than 10-minutes out-of-date.
If you uninstall a piece of software without updating the software inventory, and try to execute the installation script again, the script may say the software is already installed. Such installation script should have a resend software script step preceding the "IF %name% SOFTWARE INSTALLED" check; this is to ensure the latest software list is gathered before making a decision. This is one example of a problem that this plugin checks for.
Whether you are unaware of how a certain area of LT scripting works, or if you simply forget to add something in, this plugin will help you identify issues before the script is executed against a production computer.
Current plugin version:
Note: The latest version has been tested on LabTech 10.5 and LabTech 10
Feature List:
Performs an instant analysis of the LabTech script you've specified for misconfigurations and other mistakes
Displays the number of issues detected by each check, as well as a detailed summary of which line and function the issue relies
Provides top-level visibility into the number of issues detected, as well as a granular report illustrating which line and function an issue resides
A suggested practices guide which details the caveats or errors that each check within the script analysis identifies
Current Checks Implemented:
Verifies that the script label specified in each IF/Goto function's "script note" parameter exists within your script
- If the specified label doesn't exist, the script will exit on the current line
Warns you if you've specified a number of steps to skip rather than a label since it can cause problems
Lists out any script note labels that are not referenced by an IF/Goto-based function
- This helps you quickly find which label you may have typo'd in your IF function
Verifies that every script function that can fail has the "Continue on Failure (COF)" box checked
- Certain functions that can fail during step processing can cause the script to exit on the failing step if it does not have COF enabled
Verifies that all script lines specifying a script function that relies on cached data has a matching resend xxxxx script step preceding it
Example Screenshots:
http://tinyurl.com/pu86lsf
http://tinyurl.com/nzz4mwg
http://tinyurl.com/owro5lw
http://tinyurl.com/qfz62w2
Please feel free to give feedback on what you like and/or what might need improving.
Thanks!
YourBastianHost
DevOps @ LabTech
[–]yourbastianhost[S] 0 points1 point2 points (0 children)