NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
176 stars 95 forks source link

NCPA 3 - Windows -- logs endpoint broken when passive running #1075

Closed ne-bbahn closed 3 months ago

ne-bbahn commented 6 months ago
          I have the same problem. Here is example of config and what the ncpa_passive.log says.

image image

Originally posted by @rob2791 in https://github.com/NagiosEnterprises/ncpa/issues/1030#issuecomment-1836293795

It seems the logs API endpoint (only on windows) doesn't work when you pass parameters to it (these are necessary for it to work in the first place).

I have verified that the endpoint (with parameters) is accessible in the interface, but not via URL/request.

ne-bbahn commented 3 months ago

I believe this should be solved in NCPA 3.0.2, but will need to investigate.

uGeeko commented 3 months ago

I had this same issue. As i was using PowerShell .ps1 scripts, we had to change the ncpa.cfg to use 64 bit powershell and not 32-bit version.

ne-bbahn commented 3 months ago

I had this same issue. As i was using PowerShell .ps1 scripts, we had to change the ncpa.cfg to use 64 bit powershell and not 32-bit version.

Have you tested to see if the issue persists with NCPA 3.0.2?

uGeeko commented 3 months ago

This was still happening for us on version 3.0.2. 64-bit NCPA can not process the following to launch Powershell. It does not understand "sysnative" part of the command. .ps1 = c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File $plugin_name $plugin_args

We switched to using the below to launch Powershell in 64-bit .ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args

ne-bbahn commented 3 months ago

It seems you had modified your configuration as .ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args is the default configuration.

Since this seems to be a configuration issue that was resolved by returning to the default configuration and I can't reproduce it, I will close this issue.