Search found 5 matches
- Wed May 29, 2024 4:02 pm
- Forum: Nagios XI
- Topic: NCPA Powershell Plugin trouble passing arguments
- Replies: 9
- Views: 2514
Re: NCPA Powershell Plugin trouble passing arguments
I wrote the script. I just tried adding some code to mitigate the issue, but it is not working. Here is the code I added, which works from powershell if I feed it a similar looking escaped path. I commented above the line that I added $path = '\"F:\\Special Apps\\Backup\\Logs\\Release\"' #...
- Wed May 29, 2024 11:20 am
- Forum: Nagios XI
- Topic: NCPA Powershell Plugin trouble passing arguments
- Replies: 9
- Views: 2514
Re: NCPA Powershell Plugin trouble passing arguments
Almost everything seems to be working now with 3.1 except passing double quotes to arguments. I need to pass double quotes to a powershell -path argument - the path has a space and powershell requires it to be wrapped in double quotes - when I pass the argument it passes it with escape characters as...
- Wed May 08, 2024 3:21 pm
- Forum: Nagios XI
- Topic: NCPA Powershell Plugin trouble passing arguments
- Replies: 9
- Views: 2514
Re: NCPA Powershell Plugin trouble passing arguments
OK, thanks for the information. Also, passing multiple arguments in a passive check using: %HOSTNAME%|TEST = plugins/test.ps1 --args "arg1" --args "arg2" --args "arg3" did not work for me either. When I do that, it only passes the last argument (arg3). Is that also a bug?
- Fri May 03, 2024 9:52 am
- Forum: Nagios XI
- Topic: NCPA Powershell Plugin trouble passing arguments
- Replies: 9
- Views: 2514
Re: NCPA Powershell Plugin trouble passing arguments
Thanks! That got me further, and the API tip makes testing much easier.
The only thing I am stuck on now is getting it to pass a path with a space. Powershell expects it to be wrapped in quotes, but I have tried double-quoting and using \ as an escape character and neither work.
The only thing I am stuck on now is getting it to pass a path with a space. Powershell expects it to be wrapped in quotes, but I have tried double-quoting and using \ as an escape character and neither work.
- Wed May 01, 2024 5:01 pm
- Forum: Nagios XI
- Topic: NCPA Powershell Plugin trouble passing arguments
- Replies: 9
- Views: 2514
NCPA Powershell Plugin trouble passing arguments
I am having trouble passing parameters using a custom powershell plugin from a Windows machine running the NCPA 3.0.0.client. To help with testing, I wrote the following PS script: param ( [string]$F='John', [string]$L='Doe', [string]$M='E' ) write-host "Success! $($F) $($M) modified $($L).&quo...