ConSol-Monitoring / snclient

SNClient+ - Cross platform monitoring agent
MIT License
48 stars 8 forks source link

check_nrpe custom check script "not a valid Win32 application" #22

Closed h4ppywastaken closed 1 year ago

h4ppywastaken commented 1 year ago

When running a custom check script with check_nrpe it throws status "UNKNOWN" with "...%1 is not a valid Win32 application." grafik

Expected Behavior

check_nrpe should return with exit status 0 and status text "OK..."

Current Behavior

check_nrpe returns with exit status 3 and status text "...%1 is not a valid Win32 application."

Context (Environment)

Monitoring Host: OMD stack with naemon core check_nrpe Plugin for Nagios Version: 4.1.0 snClient Version: 0.04 Windows

Detailed Description

snclient.ini: grafik The script does not need any arguments to run.

The exact same script and configuration worked on snClient version 0.03 and stopped working directly after I installed version 0.04. grafik

sni commented 1 year ago

previously the 0.03 started all external scripts with a powershell, the 0.04 calls os.exec on them, like the nsclient did. So if you want to run it with powershell, you need to add powershell to the command or add it as wrapped script

h4ppywastaken commented 1 year ago

Thank you I got it working again then by configuring it the same as it was with NSClient++: check_sql_gis=cmd /c echo C:\SCRIPTS\GIS\check_gis_sql_select_query.ps1; exit $LastExitCode | powershell.exe -command -