Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. ExternalMetricProvider with agent version 5

ExternalMetricProvider with agent version 5

Scheduled Pinned Locked Moved Support
10 Posts 2 Posters 107.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    F
    Benjamin Dill
    wrote on last edited by
    #1

    I recently upgraded to NetXMS 5.0.6 (from 4.5.6) and it seems there is a problem with "ExternalMetricProvider" on the agent: I'm calling a few PowerShell-scripts with different execution intervals. After restart of the agent service everything seems fine and the scripts are executed as expected, but on the second call it is behaving strange: PowerShell stops executing in the middle of the script and in the agent log I find that the external command is killed because of ExternalMetricProviderTimeout, but actually the PowerShell process is still running in the background. The external command is not exected again after that.
    I downgraded the agent to 4.5.6 and it is working as expected again.

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      Can you please enable
      DebugLevel = 7
      in agent configuration file and set it to log to file
      LogFile = /path/to/log/file

      let it run until it finishes second call of the script and share the log (you can sent it to me as private message if needed)

      1 Reply Last reply
      0
      • F
        F
        Benjamin Dill
        wrote on last edited by
        #3

        I created a minimal test-setup and it still happens. It seems the agent crashes on stopping the Windows service.


        nxagentd.log

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          I see you have two external metric providers configured. Does the problem still happen if you remove the second one?

          Can you also check with Windows Task manager, if between this line
          2024.08.14 16:18:01.182 *D* [procexec.2        ] ProcessExecutor::executeWithOutput(): process "CMD.EXE /C pwsh.exe -NoProfile C:\\NetXMS\\var\\test1.ps1" started (PID=2020)

          and that line
          2024.08.14 16:18:31.185 *D* [ext.provider      ] ExternalDataProvider::poll(): command "pwsh.exe -NoProfile C:\\NetXMS\\var\\test1.ps1" execution timeout (30000 milliseconds)

          pwsh.exe -NoProfile C:\\NetXMS\\var\\test1.ps1
          process is actually running, or it has already terminated? I'd try to add say 10 second delay inside test1.ps1, then it would be seen in Task Manager that this process starts and when it ends.

          1 Reply Last reply
          0
          • F
            F
            Benjamin Dill
            wrote on last edited by
            #5

            Yes, the problem still happens with one script (second ExternalMetricProvider removed).
            No, the process pwsh.exe is not running after the script is finished in this test-setup. The PowerShell-file was empty before and I added 10 seconds of delay, but it does not change the behavior.

            1 Reply Last reply
            0
            • F
              F
              Filipp Sudanov
              wrote on last edited by
              #6

              Can you actually share your powershell script (or some version of it with which gives same results).
              Also, what's the version of powershell itself - it might make some difference.

              1 Reply Last reply
              0
              • F
                F
                Benjamin Dill
                wrote on last edited by
                #7

                Sure, but the script does almost nothing.

                Start-Transcript -Path "$($PSScriptRoot)\$(Split-Path $PSCommandPath -Leaf).log" | Out-Null
                Start-Sleep -Seconds 15
                Stop-Transcript | Out-Null
                

                On the system is the most recent version of PowerShell installed, currently 7.4.4 (I'm not using Windows PowerShell).
                https://github.com/PowerShell/PowerShell

                1 Reply Last reply
                0
                • F
                  F
                  Filipp Sudanov
                  wrote on last edited by
                  #8

                  So which exactly powershell you use and on what OS this is?

                  1 Reply Last reply
                  0
                  • F
                    F
                    Benjamin Dill
                    wrote on last edited by
                    #9

                    Windows Server 2022 and PowerShell-7.4.4-win-x64.msi

                    1 Reply Last reply
                    0
                    • F
                      F
                      Benjamin Dill
                      wrote on last edited by
                      #10

                      Just upgraded to 5.0.8 and everything looks fine again, thank you!

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups