Handles Open customer Parameter

Started by gn_cyborg, February 18, 2020, 05:54:31 PM

Previous topic - Next topic

gn_cyborg

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.

Filipp Sudanov

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.

gn_cyborg

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?

Filipp Sudanov

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.

gn_cyborg

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.

gn_cyborg

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.