Hi there,
Are you referring to this command?
check_xi_mssql_server!-U 'xxxxx' -P 'xxxxxx' -I 'xxxDB' --deadlocks --warning 20 --critical 30
Nagios SQL Plugin
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Nagios SQL Plugin
fyi, the sysperfinfo table varies between SQL versions, as you're using all 3 this could explain the error above.mindspring wrote:Nagios XI is version 5.4.0 and the SQL is running is 2012, 2014 and 2016.
Ok great I am getting different errors now.
It changed fromTo this error:Code: Select all
File "/usr/local/nagios/libexec/check_mssql_server.py", line 469, in <module> main() File "/usr/local/nagios/libexec/check_mssql_server.py", line 435, in main execute_query(mssql, options, host) File "/usr/local/nagios/libexec/check_mssql_server.py", line 448, in execute_query mssql_query.do(mssql) File "/usr/local/nagios/libexec/check_mssql_server.py", line 284, in do self.run_on_connection(connection) File "/usr/local/nagios/libexec/check_mssql_server.py", line 271, in run_on_connection self.query_result = cur.fetchone()[0] TypeError: 'NoneType' object is unsubscriptable
Does this shelp?Code: Select all
<type 'exceptions.TypeError'> 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.
Code: Select all
check_xi_mssql_server!-U 'xxxxx' -P 'xxxxxx' -I 'xxxDB' --deadlocks --warning 20 --critical 30
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Nagios SQL Plugin
In addition to @tacolover101 post I'd ask you to run the same command, from the command line, but without specifying the instance.
Do you get the same error?
Code: Select all
check_mssql_server.py -U 'xxxxx' -P 'xxxxxx' -p 1433 --deadlocks --warning 20 --critical 30As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
mindspring
- Posts: 117
- Joined: Thu Jul 19, 2012 10:24 am
Re: Nagios SQL Plugin
Thanks I am not sure I understand what @tacolover101 is asking but here is the output of the command @npolovenko
@tacolover101 can you please clarify a bit of of what you require me to do?
@tacolover101 can you please clarify a bit of of what you require me to do?
Code: Select all
[root]@nagiosxi /usr/local/nagios/libexec] $ ./check_mssql_server.py -H myhostname -U 'xxxxxx' -P 'xxxxxxx' --test
pagelooks failed with: 'NoneType' object is unsubscriptable
batchreq failed with: 'NoneType' object is unsubscriptable
connections passed!
lockwaits failed with: 'NoneType' object is unsubscriptable
pagereads failed with: 'NoneType' object is unsubscriptable
totalpages failed with: 'NoneType' object is unsubscriptable
readahead failed with: 'NoneType' object is unsubscriptable
pagewrites failed with: 'NoneType' object is unsubscriptable
stolenpages failed with: 'NoneType' object is unsubscriptable
targetpages failed with: 'NoneType' object is unsubscriptable
fullscans failed with: 'NoneType' object is unsubscriptable
locktimeouts failed with: 'NoneType' object is unsubscriptable
memory passed!
freepages failed with: 'NoneType' object is unsubscriptable
bufferhitratio failed with: list index out of range
averagewait failed with: list index out of range
checkpoints failed with: 'NoneType' object is unsubscriptable
lockrequests failed with: 'NoneType' object is unsubscriptable
pagelife failed with: 'NoneType' object is unsubscriptable
databasepages failed with: 'NoneType' object is unsubscriptable
deadlocks failed with: 'NoneType' object is unsubscriptable
cachehit failed with: list index out of range
pagesplits failed with: 'NoneType' object is unsubscriptable
lockwait failed with: 'NoneType' object is unsubscriptable
lazywrites failed with: 'NoneType' object is unsubscriptable
sqlcompilations failed with: 'NoneType' object is unsubscriptable
cpu passed!
24/27 tests failed.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Nagios SQL Plugin
@mindspring, It seems like some performance counters may be missing on your MSSQL server, or they might not work with the plugin's version.
I'd take a look at SQL server logs. In SQL server studio you can find them under Management/SQL Server Logs.
Also, on your MSSQL you could run this query to see if performance counters exist:
I'd try to match up those against the failing ones.
I'd check the user and database permissions one more time as well.
I'd take a look at SQL server logs. In SQL server studio you can find them under Management/SQL Server Logs.
Also, on your MSSQL you could run this query to see if performance counters exist:
Code: Select all
select * from sys.dm_os_performance_counters order by object_nameI'd check the user and database permissions one more time as well.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
mindspring
- Posts: 117
- Joined: Thu Jul 19, 2012 10:24 am
Re: Nagios SQL Plugin
Thanks, I am still battling with this issue.
I think I should tackle one check at a time. I want to try to get one specific database size check to work. This server is running SQL Express 2014.
This is the error I am getting
And from the command line
Any further ideas?
I think I should tackle one check at a time. I want to try to get one specific database size check to work. This server is running SQL Express 2014.
This is the error I am getting
Code: Select all
<class 'pymssql.InterfaceError'>
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.
Code: Select all
[root]@nagiosxi ~] $ /usr/local/nagios/libexec/check_mssql_server.py -H xxxx -U 'xxxx' -P 'xxxxx' -I xxxxx --test
Connection to the database failed for an unknown reason.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Nagios SQL Plugin
@mindspring, I think the fact that half of the mssql checks do work on your system indicates that the plugin works fine and can connect to the server. However, the performance counters may be missing. You said you're using SQL Express Server 2014 verses we've tested the plugin on the SQL Server 2014. Perhaps your version of MSSQL doesn't have all the monitoring capabilities that this particular plugin is using. My recommendation would be to look for an alternative plugin on the exchange.
https://exchange.nagios.org/directory/P ... /SQLServer
You could also try MSSQL database monitoring wizard in XI.
https://exchange.nagios.org/directory/P ... /SQLServer
You could also try MSSQL database monitoring wizard in XI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.