You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Customer reports that the default ncpa.cfg file on Ubuntu systems doesn't handle the setup of Python correctly. The NLS plugin in question is shebang'ed to use /bin/bash, whereas /bin/sh is symlinked on Ubuntu to /bin/dash. switchinf the ncpa.cfg for .sh files to use the bash command results in success.
Since shell scripts are normally shebang'ed (as the NLS script is) to use their shell of choice, do we even need to have the ,sh handler in ncpa.cfg?
The text was updated successfully, but these errors were encountered:
ne-bbahn
changed the title
FR - Default to shebang-specified shell instead of default extension execution for plugins
FR - Default to shebang-specified interpreter instead of default extension execution for plugins
Oct 8, 2024
I just built a new NLS (2024R1.3) cluster on Ubuntu 24.04. I was adding it to my Nagios XI (2024R1.3.2) system with the NCPA wizard and ran into this issue.
check_es_cluster_status.sh was giving this error:
"usr/local/ncpa/plugins/check_es_cluster_status.sh: 1: python2: not found
UNKNOWN: could not retrieve cluster health data"
check_es_jvm_heap.sh was giving this error:
"/usr/local/ncpa/plugins/check_es_jvm_heap.sh: 24: Syntax error: "(" unexpected"
I edited the file /usr/local/ncpa/etc/ncpa.cfg on the NLS server.
Changed the line towards the bottom of the file from this:
.sh = /bin/sh $plugin_name $plugin_args
to this:
.sh = /bin/bash $plugin_name $plugin_args
Now the check in Nagios is working properly for both of the NCPA plugin files check_es_cluster_status.sh and check_es_jvm_heap.sh
From this Forum Post https://support.nagios.com/forum/viewtopic.php?t=75785
Customer reports that the default ncpa.cfg file on Ubuntu systems doesn't handle the setup of Python correctly. The NLS plugin in question is shebang'ed to use /bin/bash, whereas /bin/sh is symlinked on Ubuntu to /bin/dash. switchinf the ncpa.cfg for .sh files to use the bash command results in success.
Since shell scripts are normally shebang'ed (as the NLS script is) to use their shell of choice, do we even need to have the ,sh handler in ncpa.cfg?
The text was updated successfully, but these errors were encountered: