Page 1 of 4

MS SQL Database configuration issues

Posted: Tue Oct 02, 2012 9:41 am
by HAL
Hi,

We have confiugured MS SQL wizards succesfully and were sucessful in monitoring couple of parameters. However, this morning we got an alert saying that the services were now critical and the status info is shown as null. I tried to test the plugin from the commdn line and executed the command ./check_mssql_server.py -h and get the below message.

import: unable to open X server `' @ import.c/ImportImageCommand/359.
./check_mssql_server.py: line 20: from: command not found
./check_mssql_server.py: line 27: requiredArgs: command not found
./check_mssql_server.py: line 28: syntax error near unexpected token `,'
./check_mssql_server.py: line 28: ` ( '-H' , 'hostname' , 'Specify MSSQL Server Address' , False ),'

I have checked the pre-requisites, they look fine. Re-installed the wizards and it is still the same.

Re: MS SQL Database configuration issues

Posted: Tue Oct 02, 2012 1:23 pm
by nscott
Can you post the output of:

cat /usr/local/nagios/etc/check_mssql_server.py | head

Also can you sucessfully instantiate a python instance? Can you run the following and return the output:

python -v
python -V

Re: MS SQL Database configuration issues

Posted: Tue Oct 02, 2012 11:51 pm
by HAL
Hi,

are you sure its etc/check_mssql_server.py? out put for that command is "No such file or directory" .

If i replace etc with libexec the the output is

#!/usr/bin/env python
################### check_mssql_database.py ####################
# Version 1.1.0
# Date : Jan 25th 2012
# Author : Nicholas Scott ( scot0357 at gmail.com )
# Help : scot0357 at gmail.com
# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
# TODO : Bug Testing, Feature Adding
# Changelog :
# 1.0.2 - Fixed Uptime Counter to be based off of database


output of python -v is
python-v.txt
output for python -V is 2.6.6

Re: MS SQL Database configuration issues

Posted: Fri Oct 05, 2012 1:30 am
by HAL
Is this an Issue with the plug-in or python??

Re: MS SQL Database configuration issues

Posted: Fri Oct 05, 2012 10:33 am
by scottwilkerson
I would guess python, but I've never seen this before...

Can you run it like this

Code: Select all

python ./check_mssql_server.py -h
Also, can we confirm the file size to make sure something hasn't happened to the plugin

Code: Select all

ll ./check_mssql_server.py

Re: MS SQL Database configuration issues

Posted: Sat Oct 06, 2012 1:12 am
by HAL
Output for the command 'python ./chewck_mssql_server.py'
python-v.txt
Output for the second command ll ./check_mssql-server.py is

-rwxr-xr-x 1 nagios users 20336 Oct 2 16:09 ./check_mssql_server.py

Re: MS SQL Database configuration issues

Posted: Sat Oct 06, 2012 12:43 pm
by scottwilkerson
HAL wrote:Output for the command 'python ./chewck_mssql_server.py'
python-v.txt
Output for the second command ll ./check_mssql-server.py is

-rwxr-xr-x 1 nagios users 20336 Oct 2 16:09 ./check_mssql_server.py
the file looks good but the attachment is the same one from before...

Re: MS SQL Database configuration issues

Posted: Sun Oct 07, 2012 12:41 am
by HAL
This is the output we got

python ./check_mssql_server.py -h
Usage: check_mssql_server.py -H hostname -U user -P password -T table --mode

Options:
-h, --help show this help message and exit

Required Options:
-H HOSTNAME, --hostname=HOSTNAME
Specify MSSQL Server Address
-U USER, --user=USER
Specify MSSQL User Name
-P PASSWORD, --password=PASSWORD
Specify MSSQL Password

Threshold Options:
-I INSTANCE, --instance=INSTANCE
Specify instance
-p PORT, --port=PORT
Specify port. [Default: 1433]
-w WARNING, --warning=WARNING
Specify min:max threshold
-c CRITICAL, --critical=CRITICAL
Specify min:max threshold

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

Re: MS SQL Database configuration issues

Posted: Mon Oct 08, 2012 9:22 am
by scottwilkerson
Ok, so it works when we pass python first...

Can you run

Code: Select all

which env

Re: MS SQL Database configuration issues

Posted: Tue Oct 09, 2012 4:50 am
by HAL
Output : /bin/env