check_mssql_server

GRANT VIEW SERVER STATE TO test;

 

http://exchange.nagios.org/directory/Plugins/Databases/SQLServer/Check-M...

License: GPL

Download:

mkdir

wget https://github.com/NagiosEnterprises/check_mssql_collection/archive/mast...

unzip master.zip

http://assets.nagios.com/downloads/nagiosxi/docs/Nagios_XI_Installing_MS...

Examples of use are:

./check_mssql_server.py -H 192.168.0.1 -U user -P password

    OK: Time to connect was 0.00482892990112s|time=0.00482892990112s;;;;;

./check_mssql_server.py -H 192.168.0.1 -U user -P password --lazywrites -w 20 -c 30

在 Ubuntu 12 有 Error

Traceback (most recent call last):
  File "./check_mssql_server.py", line 464, in <module>
    main()
  File "./check_mssql_server.py", line 430, in main
    execute_query(mssql, options, host)
  File "./check_mssql_server.py", line 443, in execute_query
    mssql_query.do(mssql)
  File "./check_mssql_server.py", line 282, in do
    self.run_on_connection(connection)
  File "./check_mssql_server.py", line 269, in run_on_connection
    self.query_result = cur.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

./check_mssql_server.py -H 192.168.88.177 -U sa -P password --lockwaits

OK: Lock Wait Average Time (ms) is 640.0ms|lockwait=640.0ms;;;;;

./check_mssql_server.py -H 192.168.88.177 -U sa -P password --deadlocks

OK: Deadlocks / Sec is 0.0/sec|deadlocks=0.0;;;;;

./check_mssql_server.py -H 192.168.88.177 -U sa -P password --batchreq

OK: Batch Requests / Sec is 0.387606349335/sec|batch_requests=0.387606349335;;;;;

--locktimeouts

OK: Lock Timeouts / Sec is 0.0/sec|lock_timeouts=0.0;;;;;

Mode Options:

--bufferhitratio Buffer Cache Hit Ratio
--pagelooks Page Lookups Per Second
--freepages Free Pages (Cumulative)
--totalpages Total Pages (Cumulative)
--targetpages Target Pages
--databasepages Database Pages
--stolenpages Stolen Pages
--lazywrites Lazy Writes / Sec
--readahead Readahead Pages / Sec
--pagereads Page Reads / Sec
--checkpoints Checkpoint Pages / Sec
--pagewrites Page Writes / Sec
--lockrequests Lock Requests / Sec
--locktimeouts Lock Timeouts / Sec
--deadlocks Deadlocks / Sec
--lockwaits Lockwaits / Sec
--lockwait Lock Wait Average Time (ms)
--averagewait Average Wait Time (ms)
--pagesplits Page Splits / Sec
--cachehit Cache Hit Ratio
--time2connect Check Time to Connect [DEFAULT]
--batchreq Batch Requests / Sec
--sqlcompilations SQL Compilations / Sec
--fullscans Full Scans / Sec
--pagelife Page Life Expectancy

 

# EPEL (el5 and el6) repo had freetds v0.91, pymssql v1.0.2-4.el6, Python v2.6.5

yum install pymssql freetds

Ubuntu-12

apt-get install python-pymssql

# freetds-common