SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionError

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

SQL Log Cache Hit Rate - type 'exceptions.ZeroDivisionError

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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;;
Be sure to check out our Knowledgebase for helpful articles and solutions!
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

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

Post 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)
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

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

Post 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]#
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

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

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

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

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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
Former Nagios Employee
Locked