Skip to content

Plugins folder - files in subdirectories have higher precedence #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
teacheroo opened this issue Mar 27, 2025 · 2 comments
Open

Plugins folder - files in subdirectories have higher precedence #1257

teacheroo opened this issue Mar 27, 2025 · 2 comments

Comments

@teacheroo
Copy link

In Windows, if you have identical script names in a subfolder in the NCPA Plugins directory, the subfolder copy of the script is executed when Nagios makes the call, even though the logs indicate the script in the root of the Plugins directory is executed.

For example, your Plugins directory is:
C:\Program Files\Nagios\NCPA\plugins\

It contains a script: hello.ps1
Contents:
Write-Host "Hello"
exit 0

You have a subdirectory inside of the Plugins directory:
C:\Program Files\Nagios\NCPA\plugins\backups\

It contains an old copy of the script, with the same name: hello.ps1
Contents:
Write-Host "Goodbye"
exit 0

When you have nagios execute the script in the root of the plugins folder, it actually executes the one in the subfolder.
check_ncpa.py -H $HOSTADDRESS$ -t $TOKEN$ -P 5693 -M 'plugins/hello.ps1' -q ''
Output: Goodbye

@ne-bbahn
Copy link
Contributor

ne-bbahn commented Apr 3, 2025

This also occurs on Linux. I have been able to replicate on both Windows and Linux and suspect we will need to modify the functionality to require specification of a directory if there are multiple instances of plugins with the same name. If anyone has suggestions or disagreements on this, let me know!

@ne-bbahn
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants