Infrastructure agent 1.20.4 breaks Flex integration on Windows

We updated the infrastructure agent on all our windows servers and found that it broke our flex integration on several windows servers.

I have whittled down the config for testing and have found that the config works fine up to New Relic Agent 1.20.3 and then breaks from 1.20.4. Now I’m not sure if this is a bug or if we have to do things differently, but either way, I’d appreciate some help please.

WORKS

Agent                         Flex Version
1.20.3                         1.4.2, 1.4.3, 1.4.4

DOESN’T WORK

Agent                         Flex Version
1.20.4                         1.4.2, 1.4.3, 1.4.4
1.23.3                         1.4.2, 1.4.3, 1.4.4

TESTING INTEGRATION CONFIG

integrations:
  - name: nri-flex
    interval: 60s
    timeout: 300s
    config:
      name: test
      apis:
        - name: PathTestInfo
          commands:
            - run: omreport.exe storage controller -fmt ssv | % {$_ -replace "$", "`n"} | % {$_ -replace "(\d+) [KMGT]+B", "`$1"}
              shell: pwsh
              split: horizontal
              split_by: ";"
              header_split_by: ";"
              regex_match: false
              header_regex_match: false
              row_header: 8
              row_start: 10
          sample_filter:
            - ID: \r
          perc_to_decimal: true
          rename_keys:
            "Cache Memory Size": "Cache Memory Size (MBytes)"

Running the nri-flex on the command line works fine regardless of the version of Infrastructure Agent or version of Flex integration.

PS C:\Program Files\New Relic\newrelic-infra> .\newrelic-integrations\nri-flex.exe -verbose -pretty -config_path "C:\Program Files\New Relic\newrelic-infra\integrations.d\test.yml"
time="2022-03-10T11:30:27Z" level=debug msg="Function.isAvailable: enter"
time="2022-03-10T11:30:27Z" level=debug msg="Function.isAvailable: exit status: false"
time="2022-03-10T11:30:27Z" level=info msg=com.newrelic.nri-flex GOARCH=amd64 GOOS=windows version=1.4.3
time="2022-03-10T11:30:27Z" level=debug msg="config: git sync configuration not set"
time="2022-03-10T11:30:27Z" level=warning msg="config: testing agent config, agent features will not be available"
time="2022-03-10T11:30:27Z" level=debug msg="config: running async" name=test
time="2022-03-10T11:30:27Z" level=debug msg="config: processing apis" apis=1 name=test
time="2022-03-10T11:30:27Z" level=debug msg="fetch: collect data" name=test
time="2022-03-10T11:30:27Z" level=debug msg="commands: executing" count=1 name=test
time="2022-03-10T11:30:29Z" level=debug msg="command: running omreport.exe storage controller -fmt ssv | % {$_ -replace \"$\", \"`n\"} | % {$_ -replace \"(\\d+) [KMGT]+B\", \"`$1\"}"
time="2022-03-10T11:30:29Z" level=debug msg="processor-data: running data handler" name=test
time="2022-03-10T11:30:29Z" level=debug msg="config: finished variable processing apis" apis=1 name=test
time="2022-03-10T11:30:29Z" level=info msg="flex: completed processing configs" configs=1
{
        "name": "com.newrelic.nri-flex",
        "protocol_version": "3",
        "integration_version": "1.4.3",
        "data": [
                {
                        "metrics": [
                                {
                                        "Abort Check Consistency on Error": "Disabled",
                                        "Alarm State": "Not Applicable",
                                        "Allow Revertible Hot Spare and Replace Member": "Enabled",
                                        "Auto Replace Member on Predictive Failure": "Disabled",
                                        "Automatic Disk Power Saving (Idle C)": "Not Applicable",
                                        "BGI Rate": 30,
                                        "Cache Memory Size (MBytes)": 512,
										<redacted for brevity>
                                        "Storport Driver Version": "10.0.14393.4825",
                                        "T10 Protection Information Capable": "No",
                                        "event_type": "PathTestInfoSample",
                                        "integration_name": "com.newrelic.nri-flex",
                                        "integration_version": "1.4.3"
                                },
                                {
                                        "event_type": "flexStatusSample",
                                        "flex.Hostname": "surrey",
                                        "flex.IntegrationVersion": "1.4.3",
                                        "flex.counter.ConfigsProcessed": 1,
                                        "flex.counter.EventCount": 1,
                                        "flex.counter.EventDropCount": 0,
                                        "flex.counter.PathTestInfoSample": 1,
                                        "flex.time.elaspedMs": 1821,
                                        "flex.time.endMs": 1646911829734,
                                        "flex.time.startMs": 1646911827913
                                }
                        ],
                        "inventory": {},
                        "events": []
                }
        ]
}

The error/result I get when querying in the Query Builder is:

e[91mInvalidOperation: e[91mCannot run a document in the middle of a pipeline: C:\Program Files\Dell\SysMgt\oma\bin\omreport.exe.e[0m

If anyone can help by either getting this fixed or telling me how I can get this working, then that would be greatly appreciated. Thanks.

So far two mods have modified this topic but no responses. Is there any process to get this escalated or actually getting this in front of the right people?

Hi, @mahomed.hussein: You are in the right place. Moderators are not support engineers; a support engineer will reply as soon as possible.

I have done a lot of further testing and concluded there is a bug with the agent calling nri-flex that uses powershell and in turn calls an external application. I have logged this as a bug in the agent GitHub repo - https://github.com/newrelic/infrastructure-agent/issues/1024

1 Like

Thanks so much for investigating and reporting the issue!

No problem. Would be great to know if/when it’ll be looked into though.

@mahomed.hussein

Nice thanks again, it can be monitored now on the link you shared which is currently showing as "open’ - https://github.com/newrelic/infrastructure-agent/issues/1024
Have a nice day, and feel free to reach back to us if there is anything else we can help you with.