Re: Powershell Output via NCPA API missing
Posted: Wed Mar 11, 2020 2:29 pm
What is the different way that the script query's the data? That could be the key here. Because this is what I'm seeing,
The entire rest of the script is derived from the $NCPA_PATH variable. For one reason or another, that Get-Process cmdlet just isn't returning data. If it were NCPA filtering the data for some reason, it would filter it for us as well, and it isn't. Something strange is happening at line 1 in the script, and $NCPA_PATH isn't getting set.
You're right, we're basically missing %NCPA_HOME% (which is a great way to reference it, btw). The very first result when you run it from the command line is C:\DCOM\Nagios\ncpa_passive.exe. This is given to you by this bit of code,Note that if I run from the command line the following output is produced:
C:\DCOM\Nagios\ncpa_passive.exe C:\DCOM\Nagios\ C:\DCOM\Nagios\var\log\ displayEnv.ps1 displayEnv.ps1.seek C:\DCOM\Nagios\var\log\displayEnv.ps1.seek
But when executed through the NCPA API the following output is produced:
Using check_ncpa.py
var\log\ displayEnv.ps1 displayEnv.ps1.seek var\log\displayEnv.ps1.seek
Code: Select all
$NCPA_PATH = Get-Process -Name ncpa_passive | Select -expand Path