NCPA plugins causing Python errors
Posted: Mon Apr 06, 2020 10:56 am
G 'Day Nagios Support,
So I have a Windows 2012 R2 system that has just installed the NCPA 2.2.0 version on which when executing PowerShell scripts fail. The failure occurs whether you use the agent's GUI or passive configuration. It all appears to have issues with the compiled binary which is for whatever reason unable to determine its embedded/internal Python interpreter. I can successfully run the PowerShell scripts from the command line but not through the agent. This is the very first time I have encountered an agent having this issue even though I have it running on nearly 1000 hosts.
Here is an example of the ERROR. Obviously the references of "C:\Python27" & "C:\ncpa" has to come from the compiled binary because this box doesn't have Python installed and ncpa is not installed on this path. Everything else functions on the agent, just plugins fail.
2020-04-03 12:06:51,994:ERROR:app:Exception on /api/plugins/check_disk_nagios.ps1/ [GET]
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
File "C:\ncpa\agent\listener\server.py", line 185, in token_auth_decoration
File "C:\ncpa\agent\listener\server.py", line 946, in api
File "C:\ncpa\agent\listener\nodes.py", line 300, in run_check
File "C:\ncpa\agent\listener\pluginnodes.py", line 107, in execute_plugin
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 585, in __init__
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 554, in __init__
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 898, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
So I am looking for some way to understand how/why the agent cannot determine its own Python implementation?
Please advise and thanks for your support,
Danny
So I have a Windows 2012 R2 system that has just installed the NCPA 2.2.0 version on which when executing PowerShell scripts fail. The failure occurs whether you use the agent's GUI or passive configuration. It all appears to have issues with the compiled binary which is for whatever reason unable to determine its embedded/internal Python interpreter. I can successfully run the PowerShell scripts from the command line but not through the agent. This is the very first time I have encountered an agent having this issue even though I have it running on nearly 1000 hosts.
Here is an example of the ERROR. Obviously the references of "C:\Python27" & "C:\ncpa" has to come from the compiled binary because this box doesn't have Python installed and ncpa is not installed on this path. Everything else functions on the agent, just plugins fail.
2020-04-03 12:06:51,994:ERROR:app:Exception on /api/plugins/check_disk_nagios.ps1/ [GET]
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
File "C:\ncpa\agent\listener\server.py", line 185, in token_auth_decoration
File "C:\ncpa\agent\listener\server.py", line 946, in api
File "C:\ncpa\agent\listener\nodes.py", line 300, in run_check
File "C:\ncpa\agent\listener\pluginnodes.py", line 107, in execute_plugin
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 585, in __init__
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 554, in __init__
File "C:\Python27\lib\site-packages\gevent\subprocess.py", line 898, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
So I am looking for some way to understand how/why the agent cannot determine its own Python implementation?
Please advise and thanks for your support,
Danny