Page 1 of 1

check_xi_mssql_query

Posted: Tue Jul 10, 2012 3:53 pm
by AshutoshSrivastava
Hi,

I am trying to set up a MSSQL Query monitor using the Monitoring wizard. Once I finish the wizard steps, I see that the command the wizard generated is:

Code: Select all

check_xi_mssql_query!-H xxx.xxx.xxx.xxx --port 1433 --username xxx --password "xxx" --database xxx --query 'SELECT COUNT(*) FROM ELMAH_Error WHERE TimeUtc >= DATEADD(mi, -20, GETUTCDATE())' --result '0' --warning 1 --critical 10
This is always returning (null) in the Nagios user interface.

If I try the following command from the Nagios server (/usr/local/nagios/libexec) , I get the expected results:

Code: Select all

check_mssql -H xxx.xxx.xxx.xxx -P 'xxx' -U xxx -d xxx SELECT COUNT(*) FROM ELMAH_Error WHERE TimeUtc >= DATEADD(mi, -20, GETUTCDATE())' -r "0" -w 1 -c 10
I cannot locate the check_xi_mssql_query command.

Why does the monitor using check_xi_mssql_query always return a (null)?

Also, what are these *_xi_* versions of the scripts/plugins? I am having the same issue with the database and the server versions of the command.

Thanks,
Ashutosh

Re: check_xi_mssql_query

Posted: Tue Jul 10, 2012 4:07 pm
by scottwilkerson
One thing I can see is you may have special chars in your password and you are wrapping the password with ' ' where the command in XI is wrapping it in " "

If this is the case you will need to escape the special chars in your password when running the wizard.

As for the _xi_ command names, when a plugin is added for a wizard, the command name is set to include _xi_ and has the $ARGn$ fields added in such a way that the wizard expects them

Re: check_xi_mssql_query

Posted: Tue Jul 10, 2012 4:45 pm
by AshutoshSrivastava
Thanks for the information. Special characters in the password were the issue in my case. I create a separate SQL login to get around the issue.

Re: check_xi_mssql_query

Posted: Wed Jul 11, 2012 7:54 am
by scottwilkerson
I thought that may be the case. Closing the thread.