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. External Parameter Help

External Parameter Help

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 31.9k 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.
  • R
    R
    Rabid
    wrote on last edited by
    #1

    I am trying to get a powershell script to run but I am receiving a communication error.  I have a folder on my test host called c:\scripts with two .ps1 files.  I have the following on the test host's config:

    ExternalParameter = Testing:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\Scripts\testing.ps1"
    ExternalParameter = Testing2:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\Scripts\testing2.ps1"

    Testing returns a value but Testing2 produces a communication error.  I have ran testing2.ps1 on the local machine and it returns a value.  I have also ran the testing2.ps1 off of the machine hosting the netxms console.

    testing2.ps1

    $a = Get-Counter -Computername valandil -Counter "\Network Interface(my adapter goes here)\Bytes Total/sec" -sampleinterval 1 | ForEach-Object{$_.CounterSamples[0].CookedValue}
    $b = Get-Counter -Computername valandil -Counter "\Network Interface(my second adapter goes here)\Bytes Total/sec" -sampleinterval 1 | ForEach-Object{$_.CounterSamples[0].CookedValue}

    $ab = $a+$b
    $ab = "{0:F0}" -f $ab
    $ab

    I have a need to take two perfmon counters and add them for a single value.  How can I fix the communication issue OR is there a way two add two counters together a different way?

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      Most likely timeout for agent command is too small (by default it's two seconds, so reading two perf counters with 1 second interval between samples for each will not fit). There was few discussions about agent timeout intervals on the forum. In short summary, two timeouts should be set correctly:

      a) ExecTimeout on agent - timeout for executing external program
      b) AgentCommandTimeout on server - timeout for any command sent from server to client

      In general AgentCommandTimeout must be greater or equal to ExecTimeout.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • R
        R
        Rabid
        wrote on last edited by
        #3

        Thanks, this worked perfectly.

        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