Page 1 of 1

Passing argument to Oracle check_xi_oraclequery command

Posted: Tue Mar 26, 2019 11:57 am
by katelee
I am trying to use $ARG2$ feature to pass parameter to my query.

--connect 'host:1521/service' --username 'username' --password 'pwd' --mode sql --name="select max(round((total_mb - free_mb)/(total_mb)*100,0)) from sys.v_\$asm_diskgroup where name like '$ARG2$'" --warning 80 --critical 90

$ARG2$ is replaced with the value I provide when I run < run command> .

But $ARG2$ is not replaced with the value I am passing when query is executed from service.
Hence the result from the query is "UNKNOWN".

Re: Passing argument to Oracle check_xi_oraclequery command

Posted: Tue Mar 26, 2019 12:15 pm
by scottwilkerson
You cannot pass values from $ARG2$ into $ARG1$, and this is in your $ARG1$

Code: Select all

--connect 'host:1521/service' --username 'username' --password 'pwd' --mode sql --name="select max(round((total_mb - free_mb)/(total_mb)*100,0)) from sys.v_\$asm_diskgroup where name like '$ARG2$'" --warning 80 --critical 90
You would need to place that value directly in $ARG1$