NCPA Passive Check Long Running Plugin
Posted: Fri Oct 18, 2019 11:22 am
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. If you click to look at the details of the service it then lists as an Unknown. 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
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. If you click to look at the details of the service it then lists as an Unknown. 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