Problems with check_mssql_database.py wizard script
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Problems with check_mssql_database.py wizard script
Hello Nagios Crew,
I hope you are all doing well.
So I am having some problems with the check_mssql_database.py script.
when launched I get the following error:
/usr/local/nagios/libexec/check_mssql_database.py -H <x.x.x.x> -U 'username' -P 'password' -I 'instancename' -T master --datasize --critical 10
<type 'exceptions.TypeError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
Is there any solution?
Thanks
SAndro
I hope you are all doing well.
So I am having some problems with the check_mssql_database.py script.
when launched I get the following error:
/usr/local/nagios/libexec/check_mssql_database.py -H <x.x.x.x> -U 'username' -P 'password' -I 'instancename' -T master --datasize --critical 10
<type 'exceptions.TypeError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
Is there any solution?
Thanks
SAndro
Re: Problems with check_mssql_database.py wizard script
Can you look at the following link to make sure the MSSQL prerequisites are installed on the server?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Another cause is in newer versions of the Microsoft database, some of the default settings were removed which causes some of the checks to fail with that error.
Third cause could be cause by a permission issue with the user account on the MSSQL server. If you can setup the account as a read only DBO account, that is usually sufficient enough for the check to run.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Another cause is in newer versions of the Microsoft database, some of the default settings were removed which causes some of the checks to fail with that error.
Third cause could be cause by a permission issue with the user account on the MSSQL server. If you can setup the account as a read only DBO account, that is usually sufficient enough for the check to run.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Problems with check_mssql_database.py wizard script
Hi
I have checked all your suggestions but still am unable to execute.
Sandro
I have checked all your suggestions but still am unable to execute.
Sandro
Re: Problems with check_mssql_database.py wizard script
Which version of SQL Server are you running this script against?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Problems with check_mssql_database.py wizard script
Another question, what are the user permissions set to in the MSSQL database?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Problems with check_mssql_database.py wizard script
The MS sql versions we are using are:
we have 2 farms with different versions Mssql 2012 and Mssql 2014
User permission on our user is sysadmin
Consider that with the same credentials we are able to successfuly execute the other check_mssql_server.py script (I do not know if this can be relevant)
Thanks
Sandro
we have 2 farms with different versions Mssql 2012 and Mssql 2014
User permission on our user is sysadmin
Consider that with the same credentials we are able to successfuly execute the other check_mssql_server.py script (I do not know if this can be relevant)
Thanks
Sandro
Re: Problems with check_mssql_database.py wizard script
I believe the check fails as you don't specify a warning threshold. Try running:
Are you getting the expected output now?
Code: Select all
/usr/local/nagios/libexec/check_mssql_database.py -H <x.x.x.x> -U 'username' -P 'password' -I 'instancename' -T master --datasize --warning 5 --critical 10Be sure to check out our Knowledgebase for helpful articles and solutions!
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Problems with check_mssql_database.py wizard script
Hi lmiltchev
Ok it works!
The only way to avoid the warning is to filter it in the messages?
I also have now this check that is failing:
/usr/local/nagios/libexec/check_mssql_database.py -H <IP> -U 'xxxUSER' -P 'xxxPASS' -T 'master' -I <Instancename> --logcachehit --warning 0:95 --critical 0:97
<type 'exceptions.ZeroDivisionError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
All other checks are working now.
Thanks
SAndro
Ok it works!
The only way to avoid the warning is to filter it in the messages?
I also have now this check that is failing:
/usr/local/nagios/libexec/check_mssql_database.py -H <IP> -U 'xxxUSER' -P 'xxxPASS' -T 'master' -I <Instancename> --logcachehit --warning 0:95 --critical 0:97
<type 'exceptions.ZeroDivisionError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
All other checks are working now.
Thanks
SAndro
Re: Problems with check_mssql_database.py wizard script
You can set up warning and critical thresholds to be the same:The only way to avoid the warning is to filter it in the messages?
Code: Select all
/usr/local/nagios/libexec/check_mssql_database.py -H <x.x.x.x> -U 'username' -P 'password' -I 'instancename' -T master --datasize --warning 10 --critical 10I believe that in order to make this particular check to work, you would need to set up the user account on your MSSQL server with Server Role = sysadmin. Can you try fixing the permissions, and let us know if this helped?I also have now this check that is failing:
/usr/local/nagios/libexec/check_mssql_database.py -H <IP> -U 'xxxUSER' -P 'xxxPASS' -T 'master' -I <Instancename> --logcachehit --warning 0:95 --critical 0:97
<type 'exceptions.ZeroDivisionError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Problems with check_mssql_database.py wizard script
Hi lmiltchev,
the strange thing about the logcachehit check I am trying, is that all other checks on the same db work as you can see in attached image. mssql.jpg.
User permissions account on my MSSQL server has Server Role = sysadmin.
if warning and critical have the same value will 2 messages/alerts be sent?
SAndro
the strange thing about the logcachehit check I am trying, is that all other checks on the same db work as you can see in attached image. mssql.jpg.
User permissions account on my MSSQL server has Server Role = sysadmin.
if warning and critical have the same value will 2 messages/alerts be sent?
SAndro
You do not have the required permissions to view the files attached to this post.