The scripting add-on for Enterprise Alert is a very powerful tool. For example you can achieve the following by using custom scripts:
- Custom alerting workflows
- Alert enrichment
- Connect custom event sources
- Trigger IT tasks
- Execute PowerShell scripts
- And much more ….
For more complex scripts you might want to reuse code. This is especially convenient if you have defined some common JavaScript functions (e.g. for data access) in a separate file.
You can insert these files by using the following function:
eval(LoadCodeFromFile("C:\\Program Files (x86)\\EnterpriseAlert\\ScriptingHost\\Scripts\\HelperFunctions.js")); MMScriptHost.LogDebug("HelperFunctions.js loaded");
That might make your scripts more readable. Happy scripting ….