check_xi_mssql_query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
AshutoshSrivastava
Posts: 2
Joined: Tue Jul 10, 2012 3:38 pm

check_xi_mssql_query

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_xi_mssql_query

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
AshutoshSrivastava
Posts: 2
Joined: Tue Jul 10, 2012 3:38 pm

Re: check_xi_mssql_query

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_xi_mssql_query

Post by scottwilkerson »

I thought that may be the case. Closing the thread.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked