Interesting... It does work from command prompt, but not from powershell. I wonder if I have to escape all the quotation marks in powershell using the ` character as well.
I'll try that and get back to you.
NSCP Settings Escape Character
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NSCP Settings Escape Character
Probably you will have some other powershell escaping to do.TechnicallyTrue wrote:Interesting... It does work from command prompt, but not from powershell. I wonder if I have to escape all the quotation marks in powershell using the ` character as well.
I'll try that and get back to you.
Best of luck!
-
- Posts: 25
- Joined: Mon May 13, 2019 11:57 am
Re: NSCP Settings Escape Character
Sure enough, the quotation marks needed to be escaped twice, once for nscp settings and once for powershell. The final command reads as follows:
Seems to work now. Thank you very much for your help.
Code: Select all
& .\nscp settings --path `"/settings/scheduler/schedules`" --key `"Drive Space C:`" --set `"check_drivesize `"`"warn=free<10G and free<10%`"`" `"`"crit=free<5G and free<5%`"`" drive=c: show-all`"
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NSCP Settings Escape Character
Great! Glad to hear you got it working!TechnicallyTrue wrote:Sure enough, the quotation marks needed to be escaped twice, once for nscp settings and once for powershell. The final command reads as follows:Seems to work now. Thank you very much for your help.Code: Select all
& .\nscp settings --path `"/settings/scheduler/schedules`" --key `"Drive Space C:`" --set `"check_drivesize `"`"warn=free<10G and free<10%`"`" `"`"crit=free<5G and free<5%`"`" drive=c: show-all`"
Locking thread