Page 1 of 1

'exceptions.ZeroDivisionError' using logcachehit

Posted: Tue Feb 28, 2017 8:21 am
by nelsonw
Hi,

I receive the error below error when running the LogCacheHitRate check with check_mssql_database.py. Please advise

/usr/local/nagios/libexec/check_mssql_database.py -H $USER8$ -U '$USER9$' -P '$USER10$' -T '$USER11$' -p 1433 --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.



Regards,
Nelson

Re: 'exceptions.ZeroDivisionError' using logcachehit

Posted: Tue Feb 28, 2017 4:33 pm
by bwallace
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 why you see 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?
- 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?


Can you log in the mssql server as the user you are running the check with, select the database, run the following query, and show us a screenshot of the results?

Code: Select all

SELECT     object_name, counter_name, instance_name, cntr_value, cntr_type
FROM         sys.sysperfinfo
WHERE     (counter_name = 'Log Cache Hit Ratio')

Re: 'exceptions.ZeroDivisionError' using logcachehit

Posted: Fri Mar 03, 2017 4:30 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @bwallace's post clear things up or has the issue otherwise been resolved?