MS SQL Wizard having extra characters in query string

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

MS SQL Wizard having extra characters in query string

Post by sujitt »

when I create a query based monitor using the MSsQL query wizard. query would not run and on inspection I found that there were extra characters embeded in the query string.
here is an example

check_xi_mssql_query!--username xxxx --password "xxxx" --database master --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "Expected result" --decode --warning 50 --critical 200
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MS SQL Wizard having extra characters in query string

Post by slansing »

Can you show us what the string "should" look like? Do you have a screenshot of the service's CCM page in CCM > Services > "Service Name" or can you copy the service definition from:

Code: Select all

/usr/local/nagios/etc/services/"servicename".cfg
Please remove any security related information.
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: MS SQL Wizard having extra characters in query string

Post by sujitt »

This is the view from CCM services edit view.
--username xxx--password "xxxx" --database master --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "Expected result" --decode --warning 50 --critical 200


the query should look like
select count(*) from sys.sysperinfo

Below is the file view

define service {
host_name xxxxx
service_description MSSQL Query - SampleQuery
use xiwizard_mssqlquery_service
check_command check_xi_mssql_query!--username xxxx --password xxxxx --database master --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "Expected result" --decode --warning 50 --critical 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mssqlquery
register 1
}
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: MS SQL Wizard having extra characters in query string

Post by abrist »

What version of XI are you running?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: MS SQL Wizard having extra characters in query string

Post by sujitt »

Nagios XI 2012R1.6
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: MS SQL Wizard having extra characters in query string

Post by abrist »

First of all, that version of XI may have an issue with url encoding in the ccm, I suggest you upgrade to 2012r2.0. Afterwards, try fixing the check $ARGn$ and let us know if the problem still persists.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: MS SQL Wizard having extra characters in query string

Post by sujitt »

we are on a trial version of xi, will upgrade work on that?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MS SQL Wizard having extra characters in query string

Post by slansing »

You should be able to download the tarball, and install it as per our upgrade instructions, you trial will still expire on the same day:

http://assets.nagios.com/downloads/nagi ... ctions.pdf
Locked