NCPA fails if there are spaces in argument -a -q
Posted: Tue Jul 31, 2018 2:50 am
I tried running a script with ncpa.
NCPA agent version 2.1.5
check_ncpa.py version 1.1.3
Working:
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -q 'args=--target C:\Test\,args=--compare eq,args=--critical 2'
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -a '--target C:\Test\ --compare eq --critical 2'
Doesn't working:
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -q 'args=--target C:\Program Files (x86)\Nagios\test.txt,args=--filter age lt -8 hours,args=--critical 0'
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -a "--target 'C:\Program Files (x86)\Nagios\test.txt' --filter 'age lt -8 hours' --critical '0'"
I think the problem is with arguments -a and -q when there is a space. "Program Files (x86)" "age lt -8 hours".
I read in discussions about a similar problem with the -m argument. https://github.com/NagiosEnterprises/ncpa/issues/14
NCPA agent version 2.1.5
check_ncpa.py version 1.1.3
Working:
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -q 'args=--target C:\Test\,args=--compare eq,args=--critical 2'
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -a '--target C:\Test\ --compare eq --critical 2'
Doesn't working:
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -q 'args=--target C:\Program Files (x86)\Nagios\test.txt,args=--filter age lt -8 hours,args=--critical 0'
/check_ncpa.py -t 'mytoken' -H X.X.X.X -P 5693 -M 'plugins/check_winfile.exe' -a "--target 'C:\Program Files (x86)\Nagios\test.txt' --filter 'age lt -8 hours' --critical '0'"
I think the problem is with arguments -a and -q when there is a space. "Program Files (x86)" "age lt -8 hours".
I read in discussions about a similar problem with the -m argument. https://github.com/NagiosEnterprises/ncpa/issues/14