NetXMS Support Forum

English Support => General Support => Topic started by: gn_cyborg on February 18, 2020, 05:54:31 PM

Title: Handles Open customer Parameter
Post by: gn_cyborg on February 18, 2020, 05:54:31 PM
Hi Guys,

First of all please excuse me, I am not that experienced with NetXMS. Long and boring story short I want to create a custom parameter that enables NetXMS to monitor the amount of file handles open. A senior colleague of mine informed me I need to add the below to the nxagentd.conf file:

ExternalParameterShellExec=FileHandlesAll(*):Command to be executed

After this I need to add a new parameter however when I click the Select... button next to Parameter FileHandlesAll doesn't appear there. Are we doing anything wrong?

Many thanks in advance.
Title: Re: Handles Open customer Parameter
Post by: Filipp Sudanov on February 20, 2020, 02:26:46 PM
Agent reads it's configuration file only on start-up, so you have to restart the agent so it will be able to ran this custom parameter.
Now, the server reads available parameters from the agent on configuration poll only. So once you've restarted the agent, you can do a manual configuration poll and then the parameter should appear in the list.
Title: Re: Handles Open customer Parameter
Post by: gn_cyborg on February 21, 2020, 01:12:54 PM
Many thanks for that! It worked. I am now however experiencing another issue. It's been at least 5 minutes since I added the customer parameter (please see attached screenshot) but nothing at all is showing up on the line chart. The command I specified in the config file was lsof| wc -l. When I run this command manually on the box it takes around 10-15 seconds to execute. This shouldn't be too long for the parameter to capture right?
Title: Re: Handles Open customer Parameter
Post by: Filipp Sudanov on February 21, 2020, 05:19:50 PM
In configuration -> Server configuration there is parameter AgentCommandTimeout that defines, how long server waits for queries to agent. By default it's 4000 ms. It's good to keep this low, otherwise, if there'll be a lot of parameters, that take to long to reply, server poller processes will be massively occupied with waiting and server will have problems with getting all the data it should.

From agent side there is param in config file ExecTimeout that defines how long agent waits for an extrenal process (2000 ms by default).

It's better to keep the above settings as the are, since there's a special approach for running long queries - ExternalParametersProvider.
(https://www.netxms.org/documentation/adminguide/agent-management.html#externalparametersprovider)

It runs long queries in the background, caches the result and passes it to the server when server requests corresponding metric.
There is parameter in agent configuration file that defines maximum timeout for command - ExternalParameterProviderTimeout (in seconds). If a command runs longer, it will be terminated.
Title: Re: Handles Open customer Parameter
Post by: gn_cyborg on February 21, 2020, 05:56:24 PM
Hi Filipp Sudanov, many thanks for your quick reply again. Currently the Server Configuration has it's AgentCommandTimeout value as 2000ms so I would have though this is OK. ExecTimeout and ExternalParameterProviderTimeout are not defined so default values apply. I'll play around with these settings and see how it goes. I may not reply until Monday but again, thanks for this.
Title: Re: Handles Open customer Parameter
Post by: gn_cyborg on February 25, 2020, 12:45:31 PM
Hi Filipp,

The monitoring for this custom parameter is very inconsistent. Changing the AgentCommandTimeout value to 4000ms got the monitoring to work initially but it seems to randomly stop monitoring. I'll have to look into this further. Thanks for your help so far.
Title: Re: Handles Open customer Parameter
Post by: Egert143 on February 25, 2020, 01:36:27 PM
Maybe its somthing similar to my post, worth reading :)

https://www.netxms.org/forum/general-support/cant-get-powershell-script-to-run/msg27392/#msg27392 (https://www.netxms.org/forum/general-support/cant-get-powershell-script-to-run/msg27392/#msg27392)