MSSQL using NSClient++

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MSSQL using NSClient++

Post by slansing »

Alright, you will need to download them from the exchange by searching their plugin names here:

http://exchange.nagios.org/

Place them in your plugins directory and make sure that they are executable. Then run one of them to get it's usage output so you can start setting up commands and services.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

well i have plugins in my plugins folder, i just dont have that check_mssql, where do i download that?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL using NSClient++

Post by lmiltchev »

You may have your plugins located in a different directory (depending on the OS/distro). Move to the plugins directory by running:

Code: Select all

cd /path/to/your/plugins/directory
...then view what plugins do you have in there:

Code: Select all

ls
If you see "check_mssql" and "check_mssql.sh" there, you can run the following commands (to view usage):

Code: Select all

./check_mssql -h
./check_mssql.sh -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

my nagios plugins are located in :

usr/lib/nagios/plugins

but there is no plugin check_mssql in here, theres check_mysql but no check_mssql.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL using NSClient++

Post by lmiltchev »

Well, if you don't have the plugins, your checks won't work. You can find these plugins here:

http://exchange.nagios.org/directory/Pl ... ql/details

https://github.com/nagios-plugins/nagio ... k_mssql.sh
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

ok so i created the check_mssql.sh and ran:

./check_mssql.sh -h

and got this :

./check_mssql.sh: 38: [: 1: unexpected operator
./check_mssql.sh: 41: [: /usr/bin/tsql: unexpected operator
./check_mssql.sh: 53: [: ==: unexpected operator
./check_mssql.sh: 55: [: ==: unexpected operator
-e is not a supported MS SQL Server version!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL using NSClient++

Post by lmiltchev »

Open the file in vi:

Code: Select all

vi check_mssql.sh
and change the first line from this:

Code: Select all

#!/bin/sh
to this:

Code: Select all

#!/bin/bash
Save and exit - type ":wq" and hit "Enter".

Note: Now you should see the usage. This is a 3rd party plugin. We cannot guarantee it is going to work as expected. I included the download link, because you had the check set up, but you were missing the plugin.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

this is what i get when i run:

./check_mssql.sh -h



You did not supply enough arguments.
Usage: ./check_mssql.sh <host> <username> <password> <version>

./check_mssql.sh checks Microsoft SQL Server connectivity. It works with versions 7 and 2000.

You need a working version of FreeTDS (http://www.freetds.org/) and tsql (included in FreeTDS 6.0+) to connect to the SQL server.
It was written by Tom De Blende ([email protected]) in 2003.

Example:
./check_mssql.sh dbserver sa f00bar 2000
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: MSSQL using NSClient++

Post by ofadl »

ok i got it working, and it returned output. You guys said i have to define command definitions now?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL using NSClient++

Post by lmiltchev »

You already have this command defined (from one of your previous posts):

Code: Select all

# 'check_mssql.sh' command definition
define command{
command_name check_mssql.sh
command_line $USER1$/check_mssql.sh zdat520 sa dusT#Controle
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked