Page 1 of 1

NCPA Passive Check Long Running Plugin

Posted: Fri Oct 18, 2019 11:22 am
by onegative
G 'Day Support,

I am experiencing an issue with a NCPA Passive check calling a custom plugin that executes a long running process (about 60 to 80 seconds run time)

i.e.
my passive_check cfg entry

[passive checks]
%HOSTNAME%|Plugin-check_bodar_incoming_sftp = plugins/check_bodar_incoming_sftp.sh


my plugin script (check_bodar_incoming_sftp.sh) which requires the use of sudo to execute root python script

#!/bin/bash
# Script used to call sudo and root owned script
/usr/bin/sudo /opt/nagios/bin/check_bodar_incoming_sftp.py


If I execute the plugins script manually I get the expected output and expected exit status.

But allowing the ncpa_passive service to run the exact plugins results in the Status not being set in the GUI. It shows White from the Services list for the host.
svc_list.png
If you click to look at the details of the service it then lists as an Unknown.
svc_detail.png
So my question is: Is there some timing issue that should be considered for long running plugins from a ncpa passive perspective?

As always I appreciate any feedback or suggestions,
Danny

Re: NCPA Passive Check Long Running Plugin

Posted: Fri Oct 18, 2019 11:31 am
by onegative
P.S. I have many other examples of this using the exact same method (calling sudo) for ncpa_passive checks that do work and display the proper Status. Even on the same server...

Re: NCPA Passive Check Long Running Plugin

Posted: Fri Oct 18, 2019 1:54 pm
by mbellerue
There is a plugin_timeout setting that defaults to 60 seconds. In the ncpa.cfg file, it's under [plugin directives]. Try increasing that to 120 and see if your check processes as expected.

Re: NCPA Passive Check Long Running Plugin

Posted: Fri Oct 18, 2019 2:43 pm
by onegative
@mbellerue

That seems to have worked. Thank you for pointing that option out within the ncpa.cfg file.
Fully operational and reporting correct within the GUI.
You can Locked this thread.

And as always thanks for your support,
Danny