Problem Description
This KB article addresses the following NCPA error:
NCPA- Service Check Timeout After n Seconds
Assumed Knowledge
The following KB article contains an explanation of how NCPA works and may need to be referenced to completely understand the problem and solution that is provided here:
Troubleshooting The Error
Timeout Issues
You can increase the timeout on the check, though you will have to alter the check in XI and the plugin timeout in the ncpa.cfg file on the remote host.
Nagios XI check_xi_ncpa Timeout
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.
In the Nagios XI web interface navigate to Configure > Core Config Manager > Commands. This brings up the Commands page, use the Search field to search for ncpa and click Search.
Click the check_xi_ncpa command.
You can change the timeout in Nagios XI with the switch -T in the check_xi_ncpa command.
In the Command Line, add -T <time value in seconds> after $HOSTADDRESS$. Ex. -T 120
Save your changes and then click the Apply Configuration button.
NCPA Client Timeout
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. You may need to change a setting in the remote host's vi /usr/local/ncpa/etc/ncpa.cfg file depending on how high you set the timeout in Nagios XI. Edit the file with the following command:
vi /usr/local/ncpa/etc/ncpa.cfg
When using the vi editor, to make changes press i on the keyboard first to enter insert mode. Press Esc to exit insert mode.
On Windows:
c:\program file(x86)\nagios\ncpa\etc\nagios.cfg
Search for the plugin_timeout= which may need to be altered. Set this, at minimum, to the value of the timeout in Nagios XI. If you do set your timeout in Nagios XI higher, increase the plugin_timeout to match.
Nagios XI Global Timeout
Nagios XI by default has a global timeout for host (30 seconds) and service (60 seconds) check commands. This means if you were 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, navigate to Configure > Core Config Manager > CCM Admin > Core Configs. This brings up the Core Configs page and by default the General [nagios.cfg] tab is selected. The two directives to change are:
host_check_timeout=30
service_check_timeout=60
Click Save Changes to update these settings and then Apply Config via Quick Tools.
A Realistic Discussion On Timeouts
After reading all of that you might think to yourself "I'm going to go and change all the timeouts to 120 seconds". It's not as simple as that, you need to take into account that each layer of timeout needs to take into account the previous layer. If 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, you will need to take that into account, here's an example of the "layers":
-
Nagios XI Global Timeout
- 120
-
check_xi_ncpa timeout on Nagios XI server
- 119
-
plugin_timeout= on NCPA Client
- 118
Final Thoughts
For any support related questions please visit the Nagios Support Forums at: