External parameters providers poller thread will not start

Started by Jamie, February 23, 2012, 01:47:23 AM

Previous topic - Next topic

Jamie

I am getting "External parameters providers poller thread will not start" in the netXMS Win32 Agent log file.

I am having trouble get the agent to run a CMD file is this message connected to that?

Victor Kirhenshtein

No, it's not related. Poller thread will start only if you have one or more ExternalParametersProvider options. Please give more details about your configuration - agent config, DCI configuration, etc. Also, did you restart agent after you specify new external parameter?

Best regards,
Victor

Jamie

Below is a paste of the nxagentd.conf and text from nxagentd.exe window.
I have entered the word Test as a Parameter in the Data Collection Configuration window.
In the Last Values window it shows Test with timestamp 1/1/70 with the Value field empty.
I've also tried a .cmd file with no sign the agent is running the cmd.


C:\NetXMS\bin>nxagentd -c C:\NetXMS\etc\nxagentd.conf -D 9
[24-Feb-2012 09:40:46] Additional configs was loaded from C:\nxagentd.conf.d
[24-Feb-2012 09:40:46] Debug level set to 9
[24-Feb-2012 09:40:46] Subagent API initialized
[24-Feb-2012 09:40:46] Subagent "WINNT.NSM" loaded successfully
[24-Feb-2012 09:40:46] Debug callback set for DB library
[24-Feb-2012 09:40:46] Subagent "winperf.nsm" loaded successfully
[24-Feb-2012 09:40:46] Subagent "portcheck.nsm" loaded successfully
[24-Feb-2012 09:40:46] Counter set B is empty, collector thread for that set wil
l not start
[24-Feb-2012 09:40:46] Counter set C is empty, collector thread for that set wil
l not start
[24-Feb-2012 09:40:47] External parameters providers poller thread will not star
t
[24-Feb-2012 09:40:47] Trying to bind on 0.0.0.0:4700
[24-Feb-2012 09:40:47] Listening on socket 0.0.0.0:4700
[24-Feb-2012 09:40:48] NetXMS Agent started
Agent running. Press ESC to shutdown.


#
# NetXMS agent configuration file
# Created by server installer at Tue Feb 21 09:46:30 2012
#

LogFile = {syslog}
Servers = 127.0.0.1
InstallationServers = 192.168.74.128
FileStore = C:\NetXMS\var
RequireAuthentication = no
SubAgent = winperf.nsm
SubAgent = portcheck.nsm
ExternalParameterShellExec = Test:dir c:\ | wc -l




Victor Kirhenshtein

Try to run the following command on management server:

nxget <agent_ip> Test

What result you get?

Best regards,
Victor

Jamie


Victor Kirhenshtein

Ok, so it looks like agent returns something. I suppose that you don't have wc command, and so it just returns first line of dir output. Next question is why you don't see DCI value in management console. Can you post a screenshot of DCI configuration?

Best regards,
Victor

Jamie

I see that is the result of the dir. I noticed it is not returning files from C:\ so I put "" around the command and it works as expected with NXGET.
I then tried to run a CMD file and that did not work then I prefix it with the START command and it now runs the batch file.
ExternalParameterShellExec = Test:"Start C:\NetXMS\Test\Launch.cmd"

I still have problem that nothing shows in Last Values.

Victor Kirhenshtein

You should not use start there - it starts given command asynchronously, not waiting for it's completion. Agent will never get the output of the command. How you CMD file looks like? Also, you can try using form

ExternalParameter = cmd.exe /c C:\NetXMS\Test\Launch.cmd

Best regards,
Victor

Jamie

OK I will use cmd/ c

The CMD file contains
echo "Test" > C:\test.txt
exit 1


I am happy agent runs CMD file now via nxget.
So remaining problem is why server does not run agent CMD.

Victor Kirhenshtein

You should get string value from that script with nxget. Agent will return first line of output, not return code of the script. As your DCI has integer type, you are probably expect to get some numeric value. For example, to write line to a log and return value of 1, you script should looks like

@echo "Test" > C:\test.txt
echo 1

Best regards,
Victor

Jamie

The script  is nonsense and only for testing. The problem is the test file does get created with nxget but does not get created from server.
In the screenshot above can you see problem in server configuration? Is there a step on the server I am missing?

Using config below the agent is working fine. I am missing something on the server side and still get a timestamp of 1/1/70

C:\NetXMS\bin>nxget localhost Test
2

#
# NetXMS agent configuration file
# Created by server installer at Tue Feb 21 09:46:30 2012
#

LogFile = {syslog}
Servers = 127.0.0.1
InstallationServers = 192.168.74.128
FileStore = C:\NetXMS\var
RequireAuthentication = no
SubAgent = winperf.nsm
SubAgent = portcheck.nsm
ExternalParameterShellExec = Test:"Echo 2"

Agent running. Press ESC to shutdown.
[25-Feb-2012 10:28:55] Incoming connection from 127.0.0.1
[25-Feb-2012 10:28:55] Connection from 127.0.0.1 accepted
[25-Feb-2012 10:28:55] [session:0] Received control message CMD_GET_NXCP_CAPS
[25-Feb-2012 10:28:55] [session:0] Sending message CMD_NXCP_CAPS (size 16)
[25-Feb-2012 10:28:55] [session:0] Received message CMD_KEEPALIVE
[25-Feb-2012 10:28:55] [session:0] Sending message CMD_REQUEST_COMPLETED (size 3
2)
[25-Feb-2012 10:28:55] [session:0] Received message CMD_GET_PARAMETER
[25-Feb-2012 10:28:55] [session:0] Requesting parameter "Test"
[25-Feb-2012 10:28:55] H_ExternalParameter called for "Test" "S"Echo 2""
[25-Feb-2012 10:28:55] H_ExternalParameter: command line is ""Echo 2""
[25-Feb-2012 10:28:55] H_ExternalParameter (shell exec): worker thread created
[25-Feb-2012 10:28:55] H_ExternalParameter/POpenWorker: worker thread pipe read
result: 00B79EB0
[25-Feb-2012 10:28:55] H_ExternalParameter (shell exec): execution status 0
[25-Feb-2012 10:28:55] [session:0] Sending message CMD_REQUEST_COMPLETED (size 4
8)
[25-Feb-2012 10:28:55] [session:0] Session with 127.0.0.1 closed



Victor Kirhenshtein

I don't see any problem with DCI configuration. However, from the agent trace I see that server does not connect to agent at all. What DNS name/IP address set as primary host name for the node object (on communication tab in properties)? Try to do forced configuration poll (right click on node, then Poll -> Configuration). Maybe connections initiated by server process blocked by firewall?

Best regards,
Victor

Jamie

Both server and agent are on localhost (Windows2003 VMWare).

I changed the IP address in the Communication Tab to localhost and it works now.

Thank you for your help.