MS SQL Database configuration issues

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

MS SQL Database configuration issues

Post 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.
Last edited by HAL on Tue Oct 30, 2012 7:32 am, edited 1 time in total.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: MS SQL Database configuration issues

Post 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
Nicholas Scott
Former Nagios employee
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: MS SQL Database configuration issues

Post 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
You do not have the required permissions to view the files attached to this post.
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: MS SQL Database configuration issues

Post by HAL »

Is this an Issue with the plug-in or python??
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MS SQL Database configuration issues

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: MS SQL Database configuration issues

Post 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
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MS SQL Database configuration issues

Post 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...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: MS SQL Database configuration issues

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MS SQL Database configuration issues

Post by scottwilkerson »

Ok, so it works when we pass python first...

Can you run

Code: Select all

which env
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: MS SQL Database configuration issues

Post by HAL »

Output : /bin/env
Locked