Hi,
I have created my own powershell check file exsist script. But Im stuck when i use arguments. If i use a path as an argument. lik: D:\Temp\Center\ it won’t work. If i add the path to my script and the other arguments it works.
Is it not possible to add paths as an argument.
The line in the nsclient.ini is:
check_file_crm = cmd /c echo scripts\check_file.ps1 $ARG1$ $ARG2$ $ARG3$; exit ($lastexitcode) | powershell.exe -command –
To test the file i do it from my nagios server../check_nrpe -n -H 10.X.X.X -C check_file_crm -a D:\Temp\Center\ test.txt 60
powershell script with directory path as argument
powershell script with directory path as argument
I don't insult, I diagnose.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: powershell script with directory path as argument
I'm pretty sure you need to use double backslahes in the path:
Code: Select all
./check_nrpe -n -H 10.X.X.X -C check_file_crm -a D:\\Temp\\Center\\ test.txt 60
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.