newrelic / nri-flex

An application-agnostic, all-in-one New Relic integration integration
https://docs.newrelic.com/docs/introduction-new-relics-flex-integration
Apache License 2.0
105 stars 119 forks source link

Flex integration and Powershell Scripts #333

Open gcalzetta opened 2 years ago

gcalzetta commented 2 years ago

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:

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

LLHogia commented 8 months ago

@davidgit Do you have an update for this? I have the same problem. PowerShell script can run as admin but not within New Relic. I'm getting permission denied. I have also tried invoking another PowerShell script using a specific domain user. It works fine within the PowerShell ISE but not via Flex.

LLHogia commented 8 months ago

@gcalzetta Please read the Workaround section in this bug:

448

However, I would like to see this as a native support in nri-flex. It would be very good to be able to specify a username and password which the PowerShell script should run as.