Page 1 of 2

SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionError

Posted: Mon Jan 04, 2016 1:57 pm
by dlukinski
After using standard Wizard for configuring MSSQL Database Log Cache Hit Rate

we get this error (configured for multiple SQL databases, same error):

<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.

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Mon Jan 04, 2016 2:32 pm
by tgriep
Can you look at the following like to make sure the MSSQL prerequisites are installed on the server?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
That could be one of the reasons for that error.

Are the usernames and passwords you are using to connect to the database have any special characters in i and are they setup as local accounts on the MSSQL server?

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Mon Jan 04, 2016 2:41 pm
by lmiltchev
In addition to what tgriep said, can you show us the actual command run from the command line, along with the output of it? For example:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_mssql_database.py -H x.x.x.x -U 'username' -P 'password' -T 'master' -I INSTANCE --logcachehit --warning 0:95 --critical 0:97
OK: Log Cache Hit Ratio is 57.1428571429%|log_cache_hit_ratio=57.1428571429%;0:95;0:97;;

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Mon Jan 04, 2016 3:59 pm
by dlukinski
tgriep wrote:Can you look at the following like to make sure the MSSQL prerequisites are installed on the server?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
That could be one of the reasons for that error.

Are the usernames and passwords you are using to connect to the database have any special characters in i and are they setup as local accounts on the MSSQL server?

all other checks from the same MsSQL DATABASE monitoring Wizard work (only this one does not)

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Mon Jan 04, 2016 4:24 pm
by dlukinski
lmiltchev wrote:In addition to what tgriep said, can you show us the actual command run from the command line, along with the output of it? For example:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_mssql_database.py -H x.x.x.x -U 'username' -P 'password' -T 'master' -I INSTANCE --logcachehit --warning 0:95 --critical 0:97
OK: Log Cache Hit Ratio is 57.1428571429%|log_cache_hit_ratio=57.1428571429%;0:95;0:97;;

[root@fikc-nagxiprod01 libexec]# /usr/local/nagios/libexec/check_mssql_database.py -H 10.x.x.81 -U 'xxxxxxx' -P 'zzzzzzzz' -T 'SIEBELREP' -I replica --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.
[root@fikc-nagxiprod01 libexec]#

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Mon Jan 04, 2016 5:10 pm
by tgriep
You might have to enable the sysperfinfo for your table called SIEBELREP.
By default, the master table should have that enabled, can you run the following to see if this works for you?

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H 10.x.x.81 -U 'xxxxxxx' -P 'zzzzzzzz' -T 'master' -I replica --logcachehit --warning 0:95 --critical 0:97

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Tue Jan 05, 2016 10:56 am
by dlukinski
tgriep wrote:You might have to enable the sysperfinfo for your table called SIEBELREP.
By default, the master table should have that enabled, can you run the following to see if this works for you?

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H 10.x.x.81 -U 'xxxxxxx' -P 'zzzzzzzz' -T 'master' -I replica --logcachehit --warning 0:95 --critical 0:97
Same error

[root@fikc-nagxiprod01 ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 10.x.x.81 -U 'xxxxxxx' -P 'zzzzzzzz' -T 'master' -I replica --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.

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Tue Jan 05, 2016 11:54 am
by tgriep
What are the rights that are granted to the user account on the MSSQl server?
Can you setup that account to have full access to the server to see if that helps out?

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Tue Jan 05, 2016 12:43 pm
by dlukinski
tgriep wrote:What are the rights that are granted to the user account on the MSSQl server?
Can you setup that account to have full access to the server to see if that helps out?
Would take some time to get TEST server connected.

Please keep in mind that ALL OTHER checks produced by the same Wizard work fine. Only this one does not for any Instances we tried one with.

Re: SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionEr

Posted: Tue Jan 05, 2016 3:34 pm
by rkennedy
What are the rights that are granted to the user account on the MSSQl server?
Do you have an answer to this?

Also - does your password contain any special characters? Are you using domain\username to login or just username?

See this links for a bit more info -
https://support.microsoft.com/en-us/kb/555332
http://stackoverflow.com/questions/3583 ... sql-server