check_mssql_health issues

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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_mssql_health issues

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_mssql_health issues

Post 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" ?
Former Nagios Employee.
me.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_mssql_health issues

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_mssql_health issues

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post 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
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

Post 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..
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_mssql_health issues

Post 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?
Former Nagios Employee.
me.
cchinicz
Posts: 17
Joined: Sun Dec 28, 2014 12:15 pm

Re: check_mssql_health issues

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