MSSQL Checks to show result in "Status Information"
-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
MSSQL Checks to show result in "Status Information"
Hello all, I was hoping to have the MSSQL Checks to show the result in "Status Information".
It shows us the mssql query duration which i would rather not see when looking at the service checks.
Is there a way that could be done just like what we have for other normal checks?
It shows us the mssql query duration which i would rather not see when looking at the service checks.
Is there a way that could be done just like what we have for other normal checks?
Re: MSSQL Checks to show result in "Status Information"
I'm not sure which plugin gets used by the MSSQL Configuration Wizard, but check_mssql.php has options for returning query results as part of the status information:
In this case, each "Query result" is a column that was returned. Unfortunately that plugin doesn't name the columns.
Code: Select all
[root@nagios libexec]# ./check_mssql.php --hostname 1.1.1.1 --username username --password password --port 1443 --database database --query "EXEC some_sp @field1=2815, @field2=76;"
OK: Query duration=0.023742 seconds. Query result=2815 Query result=09 Query result=4.2199999999999998 Query result=45.5 Query result=3.9780000000000002 Query result=0 Query result=4.2199999999999998 Query result=3.9780000000000002 Query result=89 Query result=1 Query result=1 Query result=1 Query result=1|query_duration=0.023742s;Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: MSSQL Checks to show result in "Status Information"
I am using check_mssql ver. 0.8.1, which seems to be working fine.
Can you show us the command that you are running from the command line, along with the output of it?
Code: Select all
/usr/local/nagios/libexec/check_mssql -V
0.8.1Code: Select all
/usr/local/nagios/libexec/check_mssql -H x.x.x.x --username xxx --password "xxx" --database master --instance xxx --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "1008" --decode --warning 1500 --critical 2000
OK: Query results matched "1008", query duration=0.000771 seconds.|query_duration=0.000771s;1500;2000 'computed0'=1008;You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
Re: MSSQL Checks to show result in "Status Information"
Thank you all. Upgraded to MSSQL to the newest version that i could find (8.0.) The only thing that i have had an issue with are the monitors that are connecting to a database & instance.
Has anyone had any issues with that? Monitors that only connect to the database work just fine.
Has anyone had any issues with that? Monitors that only connect to the database work just fine.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: MSSQL Checks to show result in "Status Information"
Can you show us the command that you are running from the command line, along with the output of it? If you need to PM it instead, feel free.
I have attached check_mysql .8.1 since you were not able to find it. If that does not resolve your issue, can you send me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button in the top right corner. *If* for whatever reason you cannot download the profile, please put the output of View System Info (5.3.4+, Show Profile if older). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.
If zip files are not allowed, or the attachment is too large, feel free to use http://otrs.nagios.com/upload.php but please make sure you fill in the ticket# appropriately. If you do not see the ticket # in your subject, I will be happy to give it to you.
If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
I have attached check_mysql .8.1 since you were not able to find it. If that does not resolve your issue, can you send me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button in the top right corner. *If* for whatever reason you cannot download the profile, please put the output of View System Info (5.3.4+, Show Profile if older). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.
If zip files are not allowed, or the attachment is too large, feel free to use http://otrs.nagios.com/upload.php but please make sure you fill in the ticket# appropriately. If you do not see the ticket # in your subject, I will be happy to give it to you.
If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
You do not have the required permissions to view the files attached to this post.
-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
Re: MSSQL Checks to show result in "Status Information"
Its actually the newer version of check_mssql (8.0) not mysql.
Here is the complete check command and result:
/usr/local/nagios/libexec/check_mssql_new -H HOSTNAME --username itsitepomp --password "***********" --database ******* --instance ****** --query "SELECT COUNT(1) AS [JobsExecuted]" --result "" --decode --warning 50 --critical 200 --querycritical 1
CRITICAL: Could not connect to as itsitescope (Exception: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (phledusql2.aesopprod.com) (severity 9)).
Here is the complete check command and result:
/usr/local/nagios/libexec/check_mssql_new -H HOSTNAME --username itsitepomp --password "***********" --database ******* --instance ****** --query "SELECT COUNT(1) AS [JobsExecuted]" --result "" --decode --warning 50 --critical 200 --querycritical 1
CRITICAL: Could not connect to as itsitescope (Exception: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (phledusql2.aesopprod.com) (severity 9)).
Re: MSSQL Checks to show result in "Status Information"
There are some issues with using instances and the older version of that plugin. To upgrade the to the latest version, go to the Admin > Manage Config Wizards buttons, check for updated and upgrade the MSSQL query wizard.
The plugin has to be at version 0.8.2 for this to work.
The plugin has to be at version 0.8.2 for this to work.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: MSSQL Checks to show result in "Status Information"
Also, depending on your instance name you may need to be sure it is escaped properly, like
Code: Select all
--instance "MSSQL\$$MICROSOFTWID"-
FrontlineIT
- Posts: 94
- Joined: Tue Jul 26, 2016 8:46 am
Re: MSSQL Checks to show result in "Status Information"
Scott Wilkerson,
--instance "MSSQL\$$MICROSOFTWID"
If my host is: prddb1.us.net
My database is: PRDDBA
My Instance is: PRDPROD
What would my instance look like?
--instance "MSSQL\$$MICROSOFTWID"
If my host is: prddb1.us.net
My database is: PRDDBA
My Instance is: PRDPROD
What would my instance look like?
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: MSSQL Checks to show result in "Status Information"
Were you able to upgrade to 0.8.2 using the wizard method mentioned above?FrontlineIT wrote:Its actually the newer version of check_mssql (8.0) not mysql.
Apologies for the wrong plugin. I checked the correct one and then copied the wrong one. If the wizard method doesn't work, I can drop .0.8.2 in here for you.