Page 2 of 3

Re: Stumped - check_mssql_server

Posted: Fri Apr 12, 2013 11:16 am
by abrist
Did you see:

Code: Select all

Trying <IP ADDRESS>...
And then nothing?

You could try using nmap:

Code: Select all

yum install nmap -y
nmap <IP ADDRESS> -p 1433

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 4:31 am
by Pilly170
Nmap was already installed.
[root@nagios ~]# nmap 10.4.2.63 -p 1433

Starting Nmap 5.51 ( http://nmap.org ) at 2013-04-15 10:28 CDT
Nmap scan report for 10.4.2.63
Host is up (0.0012s latency).
PORT STATE SERVICE
1433/tcp open ms-sql-s
MAC Address: 78:E7:D1:F8:D5:AC (Hewlett Packard)

Nmap done: 1 IP address (1 host up) scanned in 5.92 seconds

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 10:51 am
by slansing
Lets check this another way, from your Nagios server's terminal run the following:

Code: Select all

/usr/local/nagios/libexec/check_nt -H <MSSQL SERVER IP HERE> -s <MSSQL NSCLIENT PASSWORD HERE> -p 12489 -v COUNTER -l "\\MSSQL\$<INSTANCE NAME HERE>:Buffer Manager\Page Life expectancy","Page Life expectancy is %.fsec" -w 100: -c 50:
Lets verify that we can connect to the database from the Nagios server.

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 11:19 am
by Pilly170

Code: Select all

Page Life expectancy is 31885sec | 'Page Life expectancy is %.fsec'=31885.000000%;100.000000;50.000000;

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 11:26 am
by slansing
Great, can you now show us exactly how you ran the command through the terminal with your information "blocking out IP/password."

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 11:27 am
by Pilly170
ran this like you said

Code: Select all

[root@nagios ~]# /usr/local/nagios/libexec/check_nt -H 10.4.2.63 -s "password" -p 12489 -v COUNTER -l "\\MSSQL\$LIVE:Buffer Manager\Page Life expectancy","Page Life expectancy is %.fsec" -w 100: -c 50:

Re: Stumped - check_mssql_server

Posted: Mon Apr 15, 2013 2:20 pm
by abrist
Check the working command against the one you have configured in XI.

Re: Stumped - check_mssql_server

Posted: Tue Apr 16, 2013 2:56 am
by Pilly170
this works in cli

Code: Select all

/usr/local/nagios/libexec/check_nt -H 10.4.2.63 -s "password" -p 12489 -v COUNTER -l "\\MSSQL\$LIVE:Buffer Manager\Page Life expectancy","Page Life expectancy is %.fsec" -w 100: -c 50

If i do the test option in the service gui, by changing the $ARG3$ to:

Code: Select all

-l "\\MSSQL\$LIVE:Buffer Manager\Page Life expectancy","Page Life expectancy is %.fsec" -w 100: -c 50:

It adds extra breaks to it. and no result.

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nt -H 10.4.2.63 -s "password" -p 12489 -v COUNTER -l [b]"\\\\MSSQL\\\$LIVE:Buffer Manager\\Page Life expectancy"[/b],"Page Life expectancy is %.fsec" -w 100: -c 50 
OUTPUT: Page Life expectancy is 0sec | 'Page Life expectancy is %.fsec'=0.000000%;100.000000;50.000000;

Re: Stumped - check_mssql_server

Posted: Tue Apr 16, 2013 12:57 pm
by scottwilkerson
The "test command" button works for most basic commands but cannot decipher in some commands what needs to be esacaped.

If you save the config it should run properly

Re: Stumped - check_mssql_server

Posted: Wed Apr 17, 2013 3:39 am
by Pilly170
Ok, I will have a go with this.

But the original issue was to do with issues with check_mssql_database.py command your example is check_NT? Are you saying find the performance counter and use that instead?