Use automation scripts to add AppInsight applications to nodes with the Orion SDK
This section describes to use PowerShell scripts to add AppInsight applications to nodes via the Orion SDK, enabling you to configure large environments quickly via automation scripts provided by SolarWinds. This is a quick alternative to adding AppInsight templates via Discovery, or manually assigning templates in SAM.
The Orion SDK is a set of tools that you can use to interface with the SolarWinds Information Service (SWIS) that supports communication between the Orion server, the Orion database, Orion Platform modules like SAM and NPM, and Additional Polling Engines. As a data access layer for the Orion Platform, SWIS allows for higher-level operations than would be allowed when making changes in SQL.
New to the Orion SDK? Read Intro to API, SDK, & SWQL on THWACK, or watch Orion SDK 101: Intro to PowerShell and the Orion API.
Published on GitHub, some ways to use the Orion SDK with SAM include monitoring metrics with API pollers and managing custom properties. For many years, the SDK has supported a "CreateApplication" SWIS verb that can be used to add most SAM application monitor templates to nodes, as described in the OrionSDK wiki and THWACK, but not complex AppInsight templates.
Starting in SAM 2020.2.5, the "CreateApplication" SWIS verb supports the ability to add the following applications to nodes:
APM refers to the original name for SolarWinds SAM, which is still used in database columns and fields.
Although automation scripts can speed the configuration of large environments, you still need to verify that target nodes meet template requirements, per the SAM Application Monitor Template Reference. For example, to add AppInsight for Active Directory to a node, you'll need specific details, such as:
- LDAP port
- Global Catalog (GC) port
- Encryption method
- Authentication method
When you execute a PowerShell script from the command line or the PowerShell Integrated Scripting Environment (ISE), the script invokes the CreateApplication SWIS verb, it passes parameters such as credentials, node ID, and application template ID to the Orion SDK.
Scripts include annotations about the actions and variables involved. For example, if you set
0, the script prompts for credentials each time it runs; use
3 to inherit credentials from WMI nodes, or
4 to inherit credentials from the parent template.
Note the following details about these automation scripts:
- Scripts do not support template assignment to groups of nodes. Use the Orion Web Console instead, as described in Assign a SAM application monitor template to a group of nodes.
- For AppInsight for Active Directory, the script doesn't disable LDAP domain components by default, but you can use the DisableDomainComponents verb on the Orion.APM.ActiveDirectory.Application entity, if necessary. To learn more, see Advanced setting options.
The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.
AppInsight automation script requirements
- Use an account with Orion Administrator rights.
- Download AppInsight automation scripts from THWACK.
Review template requirements:
- Verify that PowerShell 4.0 or later is installed.
- To determine the current version, use this command:
- Add the SwisSnapin by running the following Add-PSSnapin cmdlet:
Add-PSSnapin -Name SwisSnapin
- For details, see Orion SDK PowerShell.
Depending on how it's configured, PowerShell can make your deployment vulnerable to unauthorized access. Your organization should internally review and assess to what extent PowerShell scripts are incorporated into your environment. See also PowerShell security considerations.
- To determine the current version, use this command:
- Install the Orion SDK, if necessary.
- Download the OrionSDK.msi installer from GitHub. Run the installer and complete the setup wizard.
- Documentation is available at github.com/solarwinds/OrionSDK/wiki. See also Learn the basics of using the Orion SDK in PowerShell.
- (Recommended) Back up your Orion database frequently.
- The Orion SDK includes a SWQL Studio tool for validating queries and data. SolarWinds Query Language (SWQL —rhymes with "pickle") is a proprietary, read-only subset of SQL that you can use to query your Orion database for specific network information.
The Orion SDK is a powerful tool that can impact Orion Platform data. Users should be well-versed in SQL queries with a background in programming. SolarWinds does not provide pre- or post-Sales support on any Orion SDK customizations, including code. Experiment with the Orion SDK in a non-production instance of Orion. Do not run untested PowerShell scripts against a production instance.
Execute AppInsight automation scripts
After downloading AppInsight automation scripts and verifying requirements, execute scripts either directly from the command line or from the PowerShell ISE. Provide required data, as prompted.
Due to the complexity of AppInsight for Exchange and AppInsight for IIS, extra steps (known as "Zero Config") are required on target servers, such as setting PowerShell execution policies or adding firewall rules for WinRM.
iis_create scripts include options (
shouldconfigureExchangeServer, respectively) that are set to True, by default. When you run either script, two SWIS verbs are invoked on target servers:
ScheduleConfigurationlaunches the Zero Config process.
GetConfigurationResultsummarizes changes that occurred.