Page 2 of 9
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 10:38 am
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.
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 10:57 am
by ofadl
well i have plugins in my plugins folder, i just dont have that check_mssql, where do i download that?
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 11:04 am
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:
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
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 11:08 am
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.
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 11:45 am
by lmiltchev
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 12:02 pm
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!
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 12:36 pm
by lmiltchev
Open the file in vi:
and change the first line from this:
to this:
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.
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 12:50 pm
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
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 12:58 pm
by ofadl
ok i got it working, and it returned output. You guys said i have to define command definitions now?
Re: MSSQL using NSClient++
Posted: Tue Jun 25, 2013 1:04 pm
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
}