Submit a ticketCall us

Have You Auto Renewed? If not, you're missing out.
The SolarWinds Renewal Program comes with a host of benefits including the most recent product updates, 24/7 technical support, virtual instructor-led training and more. Experience all of this with the convenience of Auto Renewal, and never worry about missing any of these great benefits. Learn More.

Home > Success Center > Server & Application Monitor (SAM) > Problems using the Orion APM Windows PowerShell Monitor

Problems using the Orion APM Windows PowerShell Monitor

Updated March 11th, 2016

Overview

This article describes troubleshooting steps in resolving common problems in using the Orion APM Windows PowerShell Monitor, such as the following:

  • Could not loadtype 'System.Management.Automation.Runspaces.WSManConnectionInfo' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e37'
  • The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests...
  • The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting.

Environment

  • SAM all versions

Resolution

Notes in using the Orion APM Windows PowerShell Monitor:

  • The Orion APM Windows PowerShell Monitor does not work with Windows PowerShell 1.0. It only works with Windows PowerShell 2.0. This requirement is stated in the APM Administrator Guide.
    You can find the documentation for the Orion APM Windows PowerShell Monitor at 
    Windows PowerShell Monitor and Creating a Windows PowerShell Monitor.
  • The field Execution Mode specifies where the PowerShell script specified in the monitor can be executed.
    The available options are:
    • Local Host - selecting this option means that the PowerShell script can only be executed locally on the Orion APM server.
    • Remote Host - selecting this option means that the PowerShell script can be executed remotely (on the selected target node) using the Windows Remote Management (WRM) system component. WRM should be configured separately to get it working with the Windows PowerShell Monitor. If Remote Host is selected, the following options are available:

 

  • Use HTTPS Protocol — if checked, specifies that the secure HTTPS protocol should be used to send and receive WS-Management protocol requests and responses. Otherwise the HTTP protocol is used.
  • URL Prefix — specifies a URL prefix on which to accept HTTP or HTTPS requests. The default is wsman.
  • Port Number — specifies the TCP port for which this listener is created. For WinRM 1.1 and earlier, the default HTTP port is 80. For WinRM 2.0, the default HTTP port is 5985.
  • If you are using Version 2 for PowerShell Version in order to execute the PowerShell script remotely, note that the Windows Remote Management (WRM) system component is used for performing the remote execution. If the Windows Remote Management (WRM) system component is not properly configured, the script execution will fail.​

Possible Errors and their resolutions:

1. Issue: Could not loadtype 'System.Management.Automation.Runspaces.WSManConnectionInfo' from assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e37' 
Cause: The machine where the Orion server is running has not installed the Windows Remote Management (WRM) system component and Windows PowerShell 2.0.

Resolution: Install PowerShell version 2.0. You can download the package at - Windows Management Framework Core package (Windows PowerShell 2.0 and WinRM 2.0) (© 2017 Microsoft, available at https://support.microsoft.com, obtained on April 24, 2017.)

2. Issue: Connecting to remote server failed with the following error message: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRMservice: winrm quickconfig. For more information, see the about_Remote_Troubleshooting Help topic.

Description: WinRM is not configured on the machine.

Resolution: On the command line, enter winrm quickconfig and select yes in the dialog for quick configuration.

 

3. Issue: Connecting to remote server failed with the following error message: The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Usewinrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.

Description: Connection could not be established because host (Orion APM server) is not trusted.

Resolution:

Option 1: Add specific trusted host by running command: winrm set winrm/config/client@{TrustedHosts="IP1, IP2"}

Option 2: Set anyhost as trusted by running command: winrm set winrm/config/client @{TrustedHosts="*"}


Requirements for PowerShell scripts to work correctly with the Windows PowerShell Script Monitor:

  • In your PowerShell script, define the string StatisticXX where XX is the output value of the script. This is a numeric value used to determine how the monitor compares to its set thresholds. The monitor is parsing statistics from the output, and if this string does not exist, the script fails.
  • Your PowerShell script must report an exit code that represents its outcome. For example, if you place the command exit(0) at the end of your PowerShell script, that exits the script and returns an error code of 0, which means the component monitor is up. You can find more information about exit codes and their meanings at Creating a Windows Script monitor.

 

Last modified

Tags

Classifications

Public