check_mssql_database.py gives exceptions.TypeError

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: check_mssql_database.py gives exceptions.TypeError

Post by sgargano »

No, it is 2008R2.

Code: Select all

[root@chlugmw1 libexec]# grep Version /usr/local/nagios/libexec/check_mssql_database.py
# Version    : 2.1.1
Same error with version 2.0.1 of the script.

Here is the result of the query:

Code: Select all

entity_name	subentity_name	permission_name
database		CONNECT
database		SELECT
database		EXECUTE 
entity_name	subentity_name	permission_name
server		CONNECT SQL
server		VIEW ANY DATABASE 
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_mssql_database.py gives exceptions.TypeError

Post by ssax »

Does your user, password, table, or instance have any special characters in them? If so, please surround them in single quotes like so and try again:

Code: Select all

./check_mssql_database.py -H SERVERNAME -U 'USER' -P 'PASSWORD' -T TABLE -I INSTANCE --time2connect  --warning 1 --critical 2
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: check_mssql_database.py gives exceptions.TypeError

Post by sgargano »

there are no special characters. In any case I tried to add the quotes but nothing changes.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: check_mssql_database.py gives exceptions.TypeError

Post by npolovenko »

@sgargano, Can you run the following commands and see if it fixes the issue?
yum install python-pip
pip install cython
Can you also check logs on the mssql server side to see what kind of errors show up when authentication fails?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sgargano
Posts: 51
Joined: Mon May 23, 2016 9:06 am

Re: check_mssql_database.py gives exceptions.TypeError

Post by sgargano »

Hello,

it looks to be fixed now.

So to summarize:
-both warning and critical values should be declared (cannot miss one of this)
-the values must be between quotes if contains special characters
-installed cython

Thanks for your support
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mssql_database.py gives exceptions.TypeError

Post by scottwilkerson »

sgargano wrote:Hello,

it looks to be fixed now.

So to summarize:
-both warning and critical values should be declared (cannot miss one of this)
-the values must be between quotes if contains special characters
-installed cython

Thanks for your support
Great!



Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked