CRITICAL: Query result cdc.Siebeldb_QA_capture was higher than Query critical threshold 2mbellerue wrote:What is the actual result of the query?
How to check SQL jobs (particular jobs)
Re: How to check SQL jobs (particular jobs)
Re: How to check SQL jobs (particular jobs)
When your result exceeds the querywarning or querycritical threshold, then you would get a non-OK state. This is by design.Hi, query works now, but provides a strange result:
CRITICAL: Query result cdc.Siebeldb_QA_capture was higher than Query critical threshold 2.
- we need this to be critical if the job is not running (--querywarning 1 --querycritical 2 --result "Expected result")
See the usage of the plugin by running:
Code: Select all
/usr/local/nagios/libexec/check_mssql -h-w, --warning Warning threshold in seconds on duration of check
-c, --critical Critical threshold in seconds on duration of check
-W, --querywarning Query warning threshold
-C, --querycritical Query critical threshold
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to check SQL jobs (particular jobs)
One more thing to clarify... If you are expecting an integer as a result, then you can use the querywarning and querycritical thresholds.
Example:
If however, your output is a string, you don't pass the querywarning and querycritical thresholds... If are expecting "cdc.Siebeldb_QA_capture", then you should use:
in your command, and NOT use the querywarning and querycritical thresholds. If the result matches, then you would get "OK", if not - you would get "CRITICAL".
Let us know if you have any further questions.
Example:
Code: Select all
/usr/local/nagios/libexec/check_mssql -H x.x.x.x --username test --password test --database master --instance test --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "1008" --decode --warning 1 --critical 2 --querywarning 1500 --querycritical 2000
OK: Query duration=0.001114 seconds. Query result=1008|query_duration=0.001114s;1;2 'computed0'=1008;1500;2000
/usr/local/nagios/libexec/check_mssql -H x.x.x.x --username test --password "test" --database master --instance test --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "1008" --decode --warning 1 --critical 2 --querywarning 500 --querycritical 1000
CRITICAL: Query result 1008 was higher than Query critical threshold 1000.|query_duration=0.000929s;1;2 'computed0'=1008;500;1000Code: Select all
--result "cdc.Siebeldb_QA_capture"Let us know if you have any further questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!