Page 2 of 2

Re: SQL Database Size check not working

Posted: Thu Nov 08, 2018 9:31 pm
by kwhogster
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

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 8:16 am
by kwhogster
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?

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 11:57 am
by tgriep
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.

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 12:27 pm
by kwhogster
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,

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 12:48 pm
by tgriep
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.

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 12:52 pm
by kwhogster
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

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 1:41 pm
by tgriep
I missed it from earlier but your command examples that are generating the error are missing one of the arguments.

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 1:54 pm
by kwhogster
Good call

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

removed that and it worked.

This is now resolved.

Re: SQL Database Size check not working

Posted: Fri Nov 09, 2018 3:32 pm
by tgriep
Glad it is working now. Let us know if it is OK to lock the post as solved.