nri-flex icon indicating copy to clipboard operation
nri-flex copied to clipboard

Flex integration and Powershell Scripts

Open gcalzetta opened this issue 2 years ago • 2 comments

Description

Hello Support, We have been having issues with New Relic Flex integration when we use it to run a powershell script. When the script contains an admin command it fails Here is the yaml config file for flex :

integrations:

  • name: nri-flex interval: 300s timeout: 60s config: name: NAME apis: - name: NAME2 - event_type: EVENT-TYPE
    shell: powershell commands: - run: "& "C:/Program Files/New Relic/newrelic-infra/integrations.d/script.ps1""

Expected Behavior

The integration works fine and the script run as aspected unless, in the script, there is an admin command.

Steps to Reproduce

The following commands, for example, need admin rights to be executed.

  1. Import-Module WebAdministration
  2. aws s3 ls s3://......... If I put one of these commands in the powershell script, the script fails when launched from flex. If I run the script manually under an admin user, the script works fine.

Your Environment

The New Relic agent runs as 'Local System' under "Windows Server 2008 R2 Standard". The problem occurs also if I force the New Relic Agent to run under any admin user.

Are you aware of this issue ? Do you have any workaround ?

cheers

gcalzetta avatar Jan 11 '22 18:01 gcalzetta