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".
Passing argument to Oracle check_xi_oraclequery command
Passing argument to Oracle check_xi_oraclequery command
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Passing argument to Oracle check_xi_oraclequery command
You cannot pass values from $ARG2$ into $ARG1$, and this is in your $ARG1$
You would need to place that value directly in $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