SQL Database Size check not working

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: SQL Database Size check not working

Postby kwhogster » Thu Nov 08, 2018 9:31 pm

I figured it out.

Had to create an AD Security group and added the SQL servers as members

root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -t 50 -H 'TGCS014-N1' -c check_sqldbsize -a 'TGCS014-N1-SQLW\wrestling wrestlinghistory 8000 5000'
OK: WRESTLINGHISTORY database size is 3 MB.

Now working

The can now be locked as resolved.

Thanks for all your help
kwhogster
 
Posts: 532
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: SQL Database Size check not working

Postby kwhogster » Fri Nov 09, 2018 8:16 am

Ooops Spoke to soon.

The update is It works on my SQL 2012 Server no problem, It also works on my SQL 2014 Server but that server has three instances.

I thought once I got it working on one instance the others would work I was wrong.

I get the a different error now but it is the same for both instances.

/usr/local/nagios/etc/objects/windowsservers# /usr/lib/nagios/plugins/check_nrpe -t 50 -H 'TGCS014-N1' -c check_sqldbsize -a 'TGCS014-N1-SQLC\ORF 8000 5000'
C:\Program Files\NSClient++\scripts\check_sqldbsize.vbs(25, 15) Microsoft VBScript runtime error: Type mismatch: 'cint'



/usr/local/nagios/etc/objects/windowsservers# /usr/lib/nagios/plugins/check_nrpe -t 50 -H 'TGCS014-N1' -c check_sqldbsize -a 'TGCS014-N1-SQLS\WSS_Content 8000 5000'

C:\Program Files\NSClient++\scripts\check_sqldbsize.vbs(25, 15) Microsoft VBScript runtime error: Type mismatch: 'cint'


from the server I ran the command against both instances and it works fine. Just from the Nagios server I get the above error

C:\Program Files\NSClient++\scripts>cscript check_sqldbsize.vbs TGCS014-N1-SQLC ORF 6000 9000
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

OK: ORF database size is 3 MB.

C:\Program Files\NSClient++\scripts>cscript check_sqldbsize.vbs TGCS014-N1-SQLS WSS_Content 6000 9000
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

OK: WSS_CONTENT database size is 45 MB.


Any ideas on the CINT error?
kwhogster
 
Posts: 532
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: SQL Database Size check not working

Postby tgriep » Fri Nov 09, 2018 11:57 am

I would guess that the the plugin is getting invalid data from the server and is having problems converting that data to an integer and is generating an error.
Check the SQL logs for any permission errors.
Verify the command is correct in the nsclient.ini file.
Check the nsclient.log file for any errors. It is in this folder.
Code: Select all
C:\Program Files\NSClient++


If you cannot figure it out, contact the Author of the plugin for any help or troubleshooting tips.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7237
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Database Size check not working

Postby kwhogster » Fri Nov 09, 2018 12:27 pm

tgriep

That's what I thought but why does the one sql instance check work?

The nsclient.ini has one line and it is the same for all three instances

I checked the sql logs no errors reported during the check.

The nsclient log has no messages for the current date.

I tried to contact the author but the Nagios site never sends me an email to verify my account something is wrong on there,
kwhogster
 
Posts: 532
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: SQL Database Size check not working

Postby tgriep » Fri Nov 09, 2018 12:48 pm

Another thing to look at, if the 2 databases that are failing are very large, that could cause the error.
The plugin uses an integer for the warning and critical values and is the data returned it larger than an integer, it could generate that error.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7237
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Database Size check not working

Postby kwhogster » Fri Nov 09, 2018 12:52 pm

not the case here

When I run the script locally

OK: ORF database size is 3 MB.

OK: WSS_CONTENT database size is 45 MB.


Databases are very small
kwhogster
 
Posts: 532
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: SQL Database Size check not working

Postby tgriep » Fri Nov 09, 2018 1:41 pm

I missed it from earlier but your command examples that are generating the error are missing one of the arguments.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7237
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Database Size check not working

Postby kwhogster » Fri Nov 09, 2018 1:54 pm

Good call

I had a / between the server name and the database name

removed that and it worked.

This is now resolved.
kwhogster
 
Posts: 532
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: SQL Database Size check not working

Postby tgriep » Fri Nov 09, 2018 3:32 pm

Glad it is working now. Let us know if it is OK to lock the post as solved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7237
Joined: Thu Oct 30, 2014 9:02 am

Previous

Return to Nagios Core

Who is online

Users browsing this forum: Google [Bot] and 13 guests