Query too long for "Check_xi_OracleQuery"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
aliprince12
Posts: 3
Joined: Wed Apr 17, 2013 8:45 am

Query too long for "Check_xi_OracleQuery"

Post by aliprince12 »

Hello,

In my "Check_xi_OracleQuery", SQL query is too long and after saving that, half of query is automatically placed in $ARG2$, that gives "OUTPUT: UNKNOWN - got no valid response for ...." error, can anybody help me how to concatenate ARG1$ & ARG2 or if there is any other way to do so?

-connect xxxxxx --username xxxxx --password "xxxxx" --encode --mode sql --name="select count(1) as count from MyTable1 mt1, MyTable2 mt2 where mt1.id=mt2.mti_id and xxxxxxxxxxx so on.................." --name2="Total" --warning 1 --critical 2

bold and highlighted query is too long in my case and that is splitted by nagios in $ARG2$, please suggest if there is any other way to fix this issue.

Thanks in advance

Regards
Ali
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Query too long for "Check_xi_OracleQuery"

Post by sreinhardt »

By default the differences in args being submitted to a check will have a space between them. I would suggest either modifying the command in CCM to remove the space, or the better suggestion would be to duplicate the check_xi_oraclequery to a unique check where your query is manually added to the command instead of being an argument(s).
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
aliprince12
Posts: 3
Joined: Wed Apr 17, 2013 8:45 am

Re: Query too long for "Check_xi_OracleQuery"

Post by aliprince12 »

Hello sreinhardt,

Apparently there are no extra spaces in my query, if i took you correct perhaps query can be longer than i have written. Can you write how can i duplicate Check_xi_oracle query, or from where i can find step by step process of your second suggestion?

Thank you.

Regards
Ali
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Query too long for "Check_xi_OracleQuery"

Post by sreinhardt »

Certainly! What you would want to do, more than likely as your situation may vary somewhat. Start by going to Configure->Core Configure Manager->Commands

Search for Check_xi_OracleQuery and copy it. (the little double sheet of paper icon to the far right, between the wrench and red X)
Use the wrench icon to modify the new Check_xi_OracleQuery_copy_1 as such:

Command Name: Check_xi_OracleQuery_Unique (or any other name you prefer)
Command Line: Alter only the end of this line. Submit your query string in, you will have to see if it needs quotes or not, in place of $ARG1$, then append a space and $ARG1$ after your query. This way you can still use $arg1$ to add warning or other parameters to your query.
Active: Check this box

Hit save, then apply configuration. Finally go into the service check you are having issues with. Change the check command used, upper right, to the check_xi_OracleQuery_Unique check. Also alter $arg1$ so that your query is removed and only warning, critical or other parameters are shown.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked