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

V

vijayrana

@vijayrana
Unfollow Follow
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • No output from ExternalParameterShellExec
    V vijayrana
    Support

    Hi,

    Yes, script is working under local system account. It is writing output to txt file. I have tried vb-script to get desired results, VB script is working fine and I am able to get results from ExternalParamaterShellExec.  But DOS script is not giving any results.

    Regards,
    Vijay.


  • Agent Service Not Starting After Configuring ExternalParametersProvider
    V vijayrana
    Support

    I have added following line nxagentd.conf on Windows Server agent.

    ExternalParametersProvider="c:\windows\system32\cscript.exe //Nologo "C:\NetXMS\scripts\MgCpuUsage.vbs"":10

    The NetXMS Agent service is not starting after adding this line.
    In windows event viewer I am getting this : "The NetXMS Agent service failed to start due to the following error: The service did not respond to the the start or control request in a timely fashion"

    When I run agent from command prompt using command ""C:\NetXMS\bin\nxagentd.exe" -c "C:\NetXMS\etc\nxagentd.conf" -n "NetXMSAgentdW32" -e "NetXMS Win32 Agent""
    it is running successfully.

    I have tried on different server the same thing happen. Kindly help.


  • No output from ExternalParameterShellExec
    V vijayrana
    Support

    I am trying to get CPU usage of a process on Microsoft Windows Server 2008 R2 using dos script. When I run dos script I am getting value. But on NetXMS server I am getting blank value. My dos script  is as following :-

    @echo off
    wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:w3wp >%temp%\cpu.txt
    set /p cph=<%temp%\cpu.txt
    for /f "delims=" %%2 in (%temp%\cpu.txt) do set CpuUsage=%%2
    set CpuUsage=%CpuUsage:w3wp=%
    set CpuUsage=%CpuUsage: =%
    rem set "%~1=%CpuUsage%"
    echo %CpuUsage%

    When I run this dos script from command prompt I get following value :-
    30

    I have configured ExternalParameterShellExecin on agent configuration file as following :-

    #
    # NetXMS agent configuration file
    # Created by agent installer at Sat May 20 17:52:36 2017
    #

    MasterServers = netxms.kochartech.com
    ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
    LogFile = C:\NetXMS\Log.txt
    DebugLevel = 9
    AgentCommandTimeout = 40000
    FileStore = C:\NetXMS\var
    SubAgent = ecs.nsm
    SubAgent = filemgr.nsm
    SubAgent = ping.nsm
    SubAgent = logwatch.nsm
    SubAgent = portcheck.nsm
    SubAgent = winperf.nsm
    SubAgent = wmi.nsm
    ExternalParameterShellExec=w3wpcpu:C:\NetXMS\scripts\CpuUsage.cmd

    I have restarted the agent. Run Poll full configuration on Node from server console.
    When I run following command from server I got blank value
    c:\NetXMS\bin>nxget X.X.X.X w3wpcpu

    On agent debug log file I got this

    [15-Jun-2017 20:57:54.262] [DEBUG] [session:1] Received message CMD_GET_PARAMETER
    [15-Jun-2017 20:57:54.262] [DEBUG] [session:1] Requesting parameter "w3wpcpu"
    [15-Jun-2017 20:57:54.262] [DEBUG] H_ExternalParameter called for "w3wpcpu" "SC:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:54.262] [DEBUG] RunExternal called for "w3wpcpu" "SC:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:54.262] [DEBUG] RunExternal: command line is "C:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:54.262] [DEBUG] RunExternal (shell exec): worker thread created
    [15-Jun-2017 20:57:54.730] [DEBUG] RunExternal (shell exec): execution status 0
    [15-Jun-2017 20:57:54.730] [DEBUG] [session:1] GetParameterValue(): result is 0 (SUCCESS)
    [15-Jun-2017 20:57:54.730] [DEBUG] [session:1] Sending message CMD_REQUEST_COMPLETED (size 48)
    [15-Jun-2017 20:57:54.730] [DEBUG] [session:1] Outgoing message dump:
      ** 001D0000000000300000000200000002
      ** 0000001C000000000000000000000000
      ** 00000015010000000000000000000000
      ** code=0x001D (CMD_REQUEST_COMPLETED) flags=0x0000 id=2 size=48 numFields=2
      ** [    28] INT32    0
      ** [    21] STRING  ""

    [15-Jun-2017 20:57:54.746] [DEBUG] [session:1] Message receiving error (MSGRECV_CLOSED)
    [15-Jun-2017 20:57:54.746] [DEBUG] [session:1] Session with X.X.X.X closed
    [15-Jun-2017 20:57:55.448] [DEBUG] [session:0] Message dump:
      ** 00410000000000300000003700000001
      ** 00000055010000000000000E00770033
      ** 00770070006300700075000000000000
      ** code=0x0041 (CMD_GET_PARAMETER) flags=0x0000 id=55 size=48 numFields=1
      ** [    85] STRING  "w3wpcpu"

    [15-Jun-2017 20:57:55.448] [DEBUG] [session:0] Received message CMD_GET_PARAMETER
    [15-Jun-2017 20:57:55.448] [DEBUG] [session:0] Requesting parameter "w3wpcpu"
    [15-Jun-2017 20:57:55.448] [DEBUG] H_ExternalParameter called for "w3wpcpu" "SC:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:55.448] [DEBUG] RunExternal called for "w3wpcpu" "SC:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:55.448] [DEBUG] RunExternal: command line is "C:\NetXMS\scripts\CpuUsage.cmd"
    [15-Jun-2017 20:57:55.448] [DEBUG] RunExternal (shell exec): worker thread created
    [15-Jun-2017 20:57:55.900] [DEBUG] RunExternal (shell exec): execution status 0
    [15-Jun-2017 20:57:55.900] [DEBUG] [session:0] GetParameterValue(): result is 0 (SUCCESS)
    [15-Jun-2017 20:57:55.900] [DEBUG] [session:0] Sending message CMD_REQUEST_COMPLETED (size 48)
    [15-Jun-2017 20:57:55.900] [DEBUG] [session:0] Outgoing message dump:
      ** 001D0008000000300000003700000002
      ** 0000001C000000000000000000000000
      ** 00000015010000000000000000000000
      ** code=0x001D (CMD_REQUEST_COMPLETED) flags=0x0008 id=55 size=48 numFields=2
      ** [    28] INT32    0
      ** [    21] STRING  ""

    Kindly help how to resolve the issue and get value on server.

  • 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