Passing argument to Oracle check_xi_oraclequery command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
katelee
Posts: 2
Joined: Tue Mar 26, 2019 11:11 am

Passing argument to Oracle check_xi_oraclequery command

Post 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".
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

Post 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$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked