Page 2 of 4

Re: check_mssql_health issues

Posted: Mon Aug 31, 2015 8:14 pm
by Box293
We're testing from Ubuntu to see if it can communicate with the Windows server on port 1433.

So the nmap command needs to be executed on the Ubuntu server.

Re: check_mssql_health issues

Posted: Thu Sep 03, 2015 10:01 am
by cchinicz
Sorry because I had not noted that you replied.. now I see there is page 2 for this post. I tried sudo namp 10.0.0.29 -p 1433 and got a "command not found" message from ubuntu. How can I run that command from the ubuntu prompt? do I need to change any permission for the ubuntu user? as this is an AWS instance, I cannot connect as root but as ubuntu instead.

Thanks again

Re: check_mssql_health issues

Posted: Thu Sep 03, 2015 10:22 am
by hsmith
cchinicz wrote:Sorry because I had not noted that you replied.. now I see there is page 2 for this post. I tried sudo namp 10.0.0.29 -p 1433 and got a "command not found" message from ubuntu. How can I run that command from the ubuntu prompt? do I need to change any permission for the ubuntu user? as this is an AWS instance, I cannot connect as root but as ubuntu instead.

Thanks again
Did you try "namp" or "nmap" ?

Re: check_mssql_health issues

Posted: Thu Sep 03, 2015 6:23 pm
by Box293
In addition to what @hsmith said, if nmap is not install then you can install it by:

Code: Select all

sudo apt-get install nmap

Re: check_mssql_health issues

Posted: Thu Sep 03, 2015 6:50 pm
by cchinicz
I've installed nmap and got the following result:

ubuntu@ip-10-0-0-10:~$ sudo nmap 10.0.0.29 -p 1433
Starting Nmap 5.21 ( http://nmap.org ) at 2015-09-03 23:48 UTC
Nmap scan report for ip-10-0-0-29.ec2.internal (10.0.0.29)
Host is up (0.00016s latency).
PORT STATE SERVICE
1433/tcp filtered ms-sql-s
MAC Address: 0E:EF:6D:77:A3:E3 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.28 seconds
ubuntu@ip-10-0-0-10:~$

Thanks all. Please dont give up on me.. let me know what's next.

Re: check_mssql_health issues

Posted: Thu Sep 03, 2015 11:36 pm
by Box293
So basically the result "filtered" means that the port is not open.

You need to open the 1433 port on the Windows firewall. For testing purposes turn off the Windows firewall.

If it still returns filtered, you also need to configure MSSQL to allow remote connections. This article should help:

http://www.scrumdesk.com/Articles/HowTo ... tions.html

Re: check_mssql_health issues

Posted: Fri Sep 04, 2015 9:33 am
by cchinicz
I've turned off the windows firewall (the aws firewall allows connections through port 1433) and the nmap command responded differently:

ubuntu@ip-10-0-0-10:~$ sudo nmap 10.0.0.29 -p 1433

Starting Nmap 5.21 ( http://nmap.org ) at 2015-09-04 14:13 UTC
Nmap scan report for ip-10-0-0-29.ec2.internal (10.0.0.29)
Host is up (0.00019s latency).
PORT STATE SERVICE
1433/tcp closed ms-sql-s
MAC Address: 0E:EF:6D:77:A3:E3 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
ubuntu@ip-10-0-0-10:~$

I followed the instructions on the link to configure mssql for protocols using sql server configuration manager but the part that deals with remote connections is for mssql 2005 and I'm running mssql 2012. I googled and found the link https://msdn.microsoft.com/en-us/library/ms187030.aspx and followed the instructions.

Untill now, I'm getting the same response from Nagios:

CRITICAL - cannot connect to 10.0.0.29. DBI connect(':host=10.0.0.29:port=1433','sa',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
at /usr/local/nagios/libexec/check_mssql_health line 3280

What am I missing?

Thanks again

Re: check_mssql_health issues

Posted: Fri Sep 04, 2015 11:26 am
by cchinicz
I hope I've made a progress by following the link http://blog.citrix24.com/configure-sql- ... nnections/ because now the nmap command shows the port is open:

ubuntu@ip-10-0-0-10:~$ sudo nmap 10.0.0.29 -p 1433

Starting Nmap 5.21 ( http://nmap.org ) at 2015-09-04 16:24 UTC
Nmap scan report for ip-10-0-0-29.ec2.internal (10.0.0.29)
Host is up (0.00023s latency).
PORT STATE SERVICE
1433/tcp open ms-sql-s
MAC Address: 0E:EF:6D:77:A3:E3 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
ubuntu@ip-10-0-0-10:~$

the bad news it that Nagios still gives the same result:

CRITICAL - cannot connect to 10.0.0.29. DBI connect(':host=10.0.0.29:port=1433','sa',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
at /usr/local/nagios/libexec/check_mssql_health line 3280

I'm still missing something. I have opened AWS firewall for port UDP 1434 as suggested in the link above, but still no good..

Re: check_mssql_health issues

Posted: Fri Sep 04, 2015 12:24 pm
by hsmith
cchinicz wrote:I hope I've made a progress by following the link http://blog.citrix24.com/configure-sql- ... nnections/ because now the nmap command shows the port is open:

ubuntu@ip-10-0-0-10:~$ sudo nmap 10.0.0.29 -p 1433

Starting Nmap 5.21 ( http://nmap.org ) at 2015-09-04 16:24 UTC
Nmap scan report for ip-10-0-0-29.ec2.internal (10.0.0.29)
Host is up (0.00023s latency).
PORT STATE SERVICE
1433/tcp open ms-sql-s
MAC Address: 0E:EF:6D:77:A3:E3 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
ubuntu@ip-10-0-0-10:~$

the bad news it that Nagios still gives the same result:

CRITICAL - cannot connect to 10.0.0.29. DBI connect(':host=10.0.0.29:port=1433','sa',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
at /usr/local/nagios/libexec/check_mssql_health line 3280

I'm still missing something. I have opened AWS firewall for port UDP 1434 as suggested in the link above, but still no good..
Have you tried to open the TCP port, or only the UDP port?

Re: check_mssql_health issues

Posted: Fri Sep 04, 2015 1:14 pm
by cchinicz
I've checked that link but could not find anything new. Answering your question, yes, I've opened both tcp port 1433 and udp 1434. Also, following the link you sent, I've also opened windows firewall outbound rules for any port/ip that communicates with the sql server.

After creating that rule, I've issued a netstat command. Below are the results of netstat after I've openend outbound rules for tcp protocol at the windows firewall:

C:\Users\Administrator>netstat -ano | find /i "600"
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING 600
TCP 10.0.0.29:1433 10.0.0.29:49382 ESTABLISHED 600
TCP 10.0.0.29:1433 10.0.0.29:49387 ESTABLISHED 600
TCP [::]:1433 [::]:0 LISTENING 600

C:\Users\Administrator>

600 is the PID of my SQL Server. Any clue of what is going on?

Thanks