mssql checks
mssql checks
I ran the mssql database and server wizards and noticed that services were flapping due to us using gearman. The gearman host apparently didn't have /usr/local/nagios/libexec/check_mssql_server.py" or /usr/local/nagios/libexec/check_mssql_database.py" We are running RHEL 6 servers. I can easily just go and make my own modifications but I'd rather ask... what is the correct way to add the repos so I can install this package?
Re: mssql checks
The document below describes how to install the prereqs for the mssql wizards/plugins:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: mssql checks
Thanks. I installed it on both gearman servers. One was ok and the other was not. Any idea what this means?
/usr/local/nagios/libexec/check_mssql_server.py -H <servername> -U '<account>' -P '<password>' -p <port> --targetpages --warning 70000 --critical 90000
DB-Lib error message 20009, severity 9:
Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Operation now in progress Error 115 - Operation now in progress
/usr/local/nagios/libexec/check_mssql_server.py -H <servername> -U '<account>' -P '<password>' -p <port> --targetpages --warning 70000 --critical 90000
DB-Lib error message 20009, severity 9:
Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Operation now in progress Error 115 - Operation now in progress
Re: mssql checks
Are you sure the username and password are correct?
Is there a firewall/ACL rule in place, either locally, in between, or on the remote DB?
Is there a firewall/ACL rule in place, either locally, in between, or on the remote DB?
Re: mssql checks
In addition to this, can you test running:
instead of
Do you get the same error?
Code: Select all
/usr/local/nagios/libexec/check_mssql_server.py -H <servername> -U '<account>' -P '<password>' -I <instance name> --targetpages --warning 70000 --critical 90000Code: Select all
/usr/local/nagios/libexec/check_mssql_server.py -H <servername> -U '<account>' -P '<password>' -p <port> --targetpages --warning 70000 --critical 90000Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: mssql checks
Yes the password is correct. I am able to obtain data from other checks. Attached is a screenshot of the checks that I am able to get working.
The rest apparently give
[Errno 13] Permission denied: '/tmp/mssql--*
or
[Traceback (most recent call last):
Not sure what these mean.
From what I've tested if I type them into the command line these seem to work:
For the Errno 13 I get this:
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --pagewrites --warning 3000000 --critical 6000000
OK: Page Writes / Sec is 0.0/sec|page_writes=0.0;3000000;6000000;;;
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --deadlocks --warning 20 --critical 30
OK: Deadlocks / Sec is 0.00120656735007/sec|deadlocks=0.00120656735007;20;30;;;
For the Tracebacks:
/usr/local/nagios/libexec/check_mssql_server.py <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --stolenpages --warning 500 --critical 700
Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mssql_server.py", line 464, in <module>
main()
File "/usr/local/nagios/libexec/check_mssql_server.py", line 430, in main
execute_query(mssql, options, host)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 443, in execute_query
mssql_query.do(mssql)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 282, in do
self.run_on_connection(connection)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 269, in run_on_connection
self.query_result = cur.fetchone()[0]
TypeError: 'NoneType' object is unsubscriptable
The rest apparently give
[Errno 13] Permission denied: '/tmp/mssql--*
or
[Traceback (most recent call last):
Not sure what these mean.
From what I've tested if I type them into the command line these seem to work:
For the Errno 13 I get this:
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --pagewrites --warning 3000000 --critical 6000000
OK: Page Writes / Sec is 0.0/sec|page_writes=0.0;3000000;6000000;;;
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --deadlocks --warning 20 --critical 30
OK: Deadlocks / Sec is 0.00120656735007/sec|deadlocks=0.00120656735007;20;30;;;
For the Tracebacks:
/usr/local/nagios/libexec/check_mssql_server.py <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --stolenpages --warning 500 --critical 700
Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mssql_server.py", line 464, in <module>
main()
File "/usr/local/nagios/libexec/check_mssql_server.py", line 430, in main
execute_query(mssql, options, host)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 443, in execute_query
mssql_query.do(mssql)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 282, in do
self.run_on_connection(connection)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 269, in run_on_connection
self.query_result = cur.fetchone()[0]
TypeError: 'NoneType' object is unsubscriptable
You do not have the required permissions to view the files attached to this post.
Re: mssql checks
Are you running these check as root or as nagios user? Can you try running them as nagios user?For the Errno 13 I get this:
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --pagewrites --warning 3000000 --critical 6000000
OK: Page Writes / Sec is 0.0/sec|page_writes=0.0;3000000;6000000;;;
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --deadlocks --warning 20 --critical 30
OK: Deadlocks / Sec is 0.00120656735007/sec|deadlocks=0.00120656735007;20;30;;;
Code: Select all
su nagios
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --pagewrites --warning 3000000 --critical 6000000
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --deadlocks --warning 20 --critical 30Code: Select all
ls -lad /tmp
ls -ls /tmp/mssql*Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: mssql checks
Thank you. I forgot about that. I removed the /tmp/mssql* files owned by root and had nagios recreate them. Those all look ok now. Any idea what the traceback calls mean? This same error occurs at the commandline as well.
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --stolenpages --warning 500 --critical 700
[Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mssql_server.py", line 464, in <module> main()
File "/usr/local/nagios/libexec/check_mssql_server.py", line 430, in main execute_query(mssql, options, host)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 443, in execute_query mssql_query.do(mssql)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 282, in do self.run_on_connection(connection)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 269, in run_on_connection self.query_result = cur.fetchone()[0]
TypeError: 'NoneType' object is unsubscriptable]
/usr/local/nagios/libexec/check_mssql_server.py -H <Servername> -U '<USERNAME>' -P '<PASSWORD>' -p 1433 --stolenpages --warning 500 --critical 700
[Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mssql_server.py", line 464, in <module> main()
File "/usr/local/nagios/libexec/check_mssql_server.py", line 430, in main execute_query(mssql, options, host)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 443, in execute_query mssql_query.do(mssql)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 282, in do self.run_on_connection(connection)
File "/usr/local/nagios/libexec/check_mssql_server.py", line 269, in run_on_connection self.query_result = cur.fetchone()[0]
TypeError: 'NoneType' object is unsubscriptable]
You do not have the required permissions to view the files attached to this post.
Re: mssql checks
This is likely because you do not have the data in the database.
If you you run this SQL query on your DB it likely won't return anything for Stolen pages and the Lock requests/sec is probably missing for your instance:
If you you run this SQL query on your DB it likely won't return anything for Stolen pages and the Lock requests/sec is probably missing for your instance:
Code: Select all
SELECT * FROM sysperfinfo WHERE counter_name LIKE '%Stolen pages%' OR counter_name LIKE '%Lock requests/sec%';Re: mssql checks
I guess if there is no data in the database I won't bother with it.
On my second gearman host I am still not able to run the /usr/local/nagios/libexec/check_mssql_database.py properly.
I get
DB-Lib error message 20009, severity 9:
Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Operation now in progress Error 115 - Operation now in progress
Same version of pymssql, freetds, and nagiosxi-nagiosplugins are installed on both.
On my second gearman host I am still not able to run the /usr/local/nagios/libexec/check_mssql_database.py properly.
I get
DB-Lib error message 20009, severity 9:
Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Operation now in progress Error 115 - Operation now in progress
Same version of pymssql, freetds, and nagiosxi-nagiosplugins are installed on both.