Stumped - check_mssql_server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Stumped - check_mssql_server

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Stumped - check_mssql_server

Post 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.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post by Pilly170 »

Code: Select all

Page Life expectancy is 31885sec | 'Page Life expectancy is %.fsec'=31885.000000%;100.000000;50.000000;
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Stumped - check_mssql_server

Post by slansing »

Great, can you now show us exactly how you ran the command through the terminal with your information "blocking out IP/password."
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post 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:
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Stumped - check_mssql_server

Post by abrist »

Check the working command against the one you have configured in XI.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

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

Re: Stumped - check_mssql_server

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Stumped - check_mssql_server

Post 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?
Locked