Nagios Team,
I want to monitor mssql queries with nagios xi mssql query wizard.
I have executed query on server which return the value in interger, I have set querywarning and querycritical thresholds as well but query result on nagios board is showing in terms of execution time.
On server, query return 4325 something value, I have set 50 and 200 as warning and critical etc but it did not work according to set thresholds.
Can you please see the guide me what if I am missing something.
all screenshots are attached for verification.
Thanks
Nagios XI mssql query wizard
Nagios XI mssql query wizard
You do not have the required permissions to view the files attached to this post.
Re: Nagios XI mssql query wizard
Please show us the service definition for 'System info query'. It looks like you have a duration query running and not a custom query.
Former Nagios Employee
Re: Nagios XI mssql query wizard
Can you show us the actual check run from the command line along with the output of it? What happens when you include "--warning" & "--critical" thresholds?
Example:
Example:
But notice the change in the output below:[root@main-nagios-xi libexec]# ./check_mssql -H x.x.x.x --username <username> --password "<password>" --database master --instance <instance> --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --decode --querywarning 50 --querycritical 200
OK: Query duration=0.001232 seconds.|query_duration=0.001232s;; 'computed'=1008;50;200
[root@main-nagios-xi libexec]# ./check_mssql -H x.x.x.x --username <username> --password "<password>" --database master --instance <instance> --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --decode --warning 1 --critical 2 --querywarning 50 --querycritical 200
CRITICAL: Query result 1008 was higher than query critcal threshold.|query_duration=0.000657s;1;2 'computed'=1008;50;200
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI mssql query wizard
Thank you for your support.
My query is as follows:
check_xi_mssql_query!--username abcd --password "123456" --database master --port 1433 --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "" --decode --querywarning 50 --querycritical 200
Your suggested query execution from command line
./check_mssql -H 1.2.3.4 --username abcd --password "123456" --database master --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --decode --warning 1 --critical 2 --querywarning 50 --querycritical 200
CRITICAL: Query result 4362 was higher than query critcal threshold.|query_duration=0.063458s;1;2 'computed'=4362;50;200
I have modified accordingly, its been working fine...
My questions are as follows:
1- Few queries return result in tabular form? How we can monitor them in terms of expected result?
2-Can I monitor the query time execution, if my query takes more than 15 minutes, it should generate alerts?
Kindly answer these.
Thank you!
My query is as follows:
check_xi_mssql_query!--username abcd --password "123456" --database master --port 1433 --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "" --decode --querywarning 50 --querycritical 200
Your suggested query execution from command line
./check_mssql -H 1.2.3.4 --username abcd --password "123456" --database master --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --decode --warning 1 --critical 2 --querywarning 50 --querycritical 200
CRITICAL: Query result 4362 was higher than query critcal threshold.|query_duration=0.063458s;1;2 'computed'=4362;50;200
I have modified accordingly, its been working fine...
My questions are as follows:
1- Few queries return result in tabular form? How we can monitor them in terms of expected result?
2-Can I monitor the query time execution, if my query takes more than 15 minutes, it should generate alerts?
Kindly answer these.
Thank you!
Re: Nagios XI mssql query wizard
@rkennedy
Service definition screenshot is attached.
Service definition screenshot is attached.
You do not have the required permissions to view the files attached to this post.
Re: Nagios XI mssql query wizard
Support team
Please help!
Its an urgent work need to done.
Please help!
Its an urgent work need to done.
Re: Nagios XI mssql query wizard
You could use the -r parameter:Naveed wrote: Few queries return result in tabular form? How we can monitor them in terms of expected result?
Code: Select all
-r, --result
Expected result from the specified query, requires -q. The query
pulls only the first row for comparison, so you should limit
yourself to small, simple queries.
You should be able to use -w and -c for this:Naveed wrote: Can I monitor the query time execution, if my query takes more than 15 minutes, it should generate alerts?
Code: Select all
-w, --warning
Warning threshold in seconds on duration of check
Accepts decimal values, note however that there must be at least a
leading 0. Example, .0023 is not a valid entry, but 0.0023 is.
-c, --critical
Critical threshold in seconds on duration of check
Accepts decimal values, note however that there must be at least a
leading 0. Example, .0023 is not a valid entry, but 0.0023 is.
https://assets.nagios.com/downloads/nag ... gmain.html
Refer to the "Service Check Timeout" section.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nagios XI mssql query wizard
In addition to mcapra's post, if the query takes longer than a few minutes I would probably look at setting it up as a passive check, that is a very long time for it to be consuming resources and would likely hit the default timeouts in your nagios.cfg unless you bump them up as well.
lmiltchev's post above shows you how to check the duration as well.
Thank you
lmiltchev's post above shows you how to check the duration as well.
Thank you
Re: Nagios XI mssql query wizard
Ok, I will implement these now and update you about the progress...
Can you please tell me that how to change duration query running and not a custom query?
Please show us the service definition for 'System info query'. It looks like you have a duration query running and not a custom query.
Thanks
Can you please tell me that how to change duration query running and not a custom query?
Please show us the service definition for 'System info query'. It looks like you have a duration query running and not a custom query.
Thanks
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm