Stuck with “Service check timed out after n Seconds” NCPA error? We can help you.
Often our customers using the Nagios XI server report that they get this NCPA error.
Here at Bobcares, we handle requests from our customers to fix this issue as a part of our Server Management Services.
Today let’s see how our Support Techs fix Service check timed out after n Seconds issue for our customers.
How to fix “Service check timed out after n Seconds”
Following are some of the methods that our Support Engineers use to fix ‘Service check timed out after n Seconds”
:1. Checking Nagios XI check_xi_ncpa Timeout to fix “Service check timed out after n Seconds”
This timeout is how long the check_xi_ncpa command on the Nagios XI server will wait for a response from the NCPA agent.
By default, the timeout is not set, thereby defaulting to the plugin timeout or the global timeout.
We can fix this type of timeout using the following steps:
1. In the Nagios XI web interface, navigate to Configure
2. Then take Core Config Manager and go to Commands.
3. In the Commands page, use the Search field to search for ncpa and click Search.
4. After that, click the check_xi_ncpa command.
5. Now we can change the timeout in Nagios XI with the switch -T in the check_xi_ncpa command.
6. In the Command Line, add -T <time value in seconds> after $HOSTADDRESS$. Ex. -T 120
7. Finally, save the changes and then click the Apply Configuration button.
2. Check NCPA Client Timeout to fix “Service check timed out after n Seconds”
This timeout is how long the NCPA client on the Nagios XI server will wait for a response from the plugin it executes before returning a result to Nagios XI.
Changing the settings in the remote host’s /usr/local/ncpa/etc/ncpa.cfg file depending on how high we set the timeout in Nagios XI will fix this issue.
We can edit the file following command:
On Windows we can use the following command:
And search for the plugin_timeout= for altering.
Furthermore, we can set this to a minimum value of the timeout in Nagios XI and increase the plugin_timeout to match it.
3. Check Nagios XI Global Timeout to fix “Service check timed out after n Seconds”
Nagios XI, by default, has a global timeout for host (30 seconds) and service (60 seconds) check commands.
This means if we have to change the check_xi_ncpa command timeout in Nagios XI with the switch -T to 120, Nagios XI will not wait for 120 seconds to pass, the global timeout will stop at 60 seconds.
To adjust the global timeout we can do the following:
1. First, navigate to Configure and take Core Config Manager
2. Then go to CCM Admin and take Core Configs.
3. In the Core Configs page we can see that by default the General [nagios.cfg] tab is selected.
Following are the two directives to change:
4. Finally, click Save Changes to update these settings and then Apply Config via Quick Tools.
Some basics to know before changing Timeouts
Generally, we may get a thought of changing all the timeouts to 120 seconds. However, it is not as simple as that, we need to take into account that each layer of timeout needs to take into account the previous layer.
If the Nagios XI global timeout was set to 120 seconds and the NCPA was plugin_timeout=120 then it may take a whole second before it gets to NCPA. Here is an example of the “layers” we have to consider before changing:
1. Nagios XI Global Timeout 120
2. check_xi_ncpa timeout on Nagios XI server 119
3. plugin_timeout= on NCPA Client 118
[Need assistance? We can help you]
In short, we saw how our Support Engineers fix “Service check timed out after n Seconds” error for our customers.