Nagios Alert - Server Down but Server is online - nagios

Receiving Nagios Server Down Alerts but this is not the case. Server is online.
All other server alerts are working correctly, only difference is this server is receiving a DHCP address which I don't believe makes any difference.
I pinged the servers and latency is not the issue. I can ping the nagios server and the nagios server is able to ping the server. Any suggestions of what I can look at, I am out of ideas. Nagios Configuration is below, I don't see how it can be wrong as I copied it from server and simply changed the server name.
define host{
use windows-server
host_name cielo01
alias cielo01
address cielo01
}
define service{
use local-service
host_name cielo01
service_description PING
check_command check_ping!500.0,20%!1000.0,60%
}
define service{
use local-service
host_name cielo01
service_description Disk Space on C
check_command check_disk_smb!C$!85!95
}

In the object definition descrition for address from the documentation it says the following:
You can use a FQDN to identify the host instead of an IP address, but
if DNS services are not available this could cause problems.
Have you tried using the FQDN?

Related

SQL Server - Query to get server's IP address with Availability Group Listener

There is another question like this and the most common answer is to use CONNECTIONPROPERTY( 'local_net_address' ). The Microsoft documentation says this returns the "targetted" address. So when I connect using an AG listener, local_net_address returns the AG listener IP no matter which SQL Server I am really connected to. So how to get the SQL Server IP address when using an AG listener?
This will be running in a secure environment and xp_cmdshell is not an option.
the SQL Server IP address when using an AG listener
A server doesn't have just one IP address. For instance the AG Listener IP you use to connect is an additional IP address for the server. It's typically as good as any other IP address the server might have.
In the most common configuration, SQL Server has absolutely no knowledge about the server's IPs. SQL Server simply listens on port 1433 all IPs.
You can query the server name and domain, and construct a DNS lookup to find an IP associated with that server name:
select DEFAULT_DOMAIN() domain, serverproperty('ComputerNamePhysicalNetBIOS') serverName

libmysql mysql_real_connect fails with localhost but works with local IP address

I am using the libmysql C API, the mysql_real_connect call only works if I use the real IP address of the host - other than localhost. If I use localhost as host I get the
following error:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (0)
The authentication should be ok, since the used user has all privileges from localhost and any host also.
By the way it is an XAMPP installation on Windows 7.
I had the same problem and the solution is to uninstall and disable IPv6 support, because if I had IPv6 support enabled then ping localhost command returns ::1: instead 127.0.0.1 as i have written in etc\hosts file, and sample mysql connect program written in C using libmysql do not connect when as host parameter to mysql_real_connect() i supplied "localhost". Now, after disabling IPv6 works both options ("localhost" or "127.0.0.1").
P.S.: I have tried this "solution" only in Windows XP SP3 Pro Czech. In Windows 7 and Linux I don't try this.
Either your DNS is broken (Does ping localhost work as expected?)
or the way "localhost" is specially treated is the problem.
The value of host may be either a host name or an IP address. If host
is NULL or the string "localhost", a connection to the local host is
assumed. For Windows, the client connects using a shared-memory
connection, if the server has shared-memory connections enabled.
Otherwise, TCP/IP is used.
see http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html
check if in your /etc/hosts file it's defined something like that: 127.0.0.1 localhost
check how mysql is binding its port:
root#dam2k:~# netstat -natp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2215/mysqld

Databse Connection error By Giving Specific IP address-Drupal

I have created database and user and give all the privilege to the user.When i give the IP as Database host.It will show the following errors.Giving hostname as localhost it will work fine.
I am using phpmyadmin 3.3.2...
The error message is given below.
Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on '192.168.85.10' (111)
It seems that the IP address you use is your "external" IP and not the IP localhost would resolve to, which is most of the time your loopback: 127.0.0.1.
So if you are trying to connect from the same computer as the database is running you should use 127.0.0.1 as the IP address.
If you are trying to connect to your database from another computer on the network, you should enable MySQL remote access in your my.conf (MySQL config file). Because by default MySQL disables remote incoming connections.
You do this by setting the "bind-address" line to your real (external) server IP as such:
bind-address = 192.168.xx.xx (assuming its on your local network)
Or put the bind-address in comment.
Also make sure that the skip-networking option is commented as such:
#skip-networking
And then restart your MySQL server.
Now also make sure that your MySQL users are also allowed to connect from locations other then "#localhost".
I hope this helps!
Cheers,
Timusan

Can't connect to SQL Server using an Alias

I have a SQL Server 2000 install on a server that I am having weird connection issues with.
Using SSMS I can't connect to it using an Alias I have setup on Configuration Manager. The Alias is set to use TCPIP which is the first protocol in the order below shared memory. If I use the exact same server name I put into the Alias then I can connect just fine.
I see the exact same behavior in my ASP.NET application, using the alias I get a connection failure, using the name it connects just fine. The ASP.NET connection string is not specifying a protocol.
Using the server name will use the default connection protocol for the client.
This may be named pipes or tcp/ip (MDAC version, upgrade vs install etc).
The Alias is set to use TCPIP which is
the first protocol in the order below
shared memory
I assume that if the client alias is set to use tcp, then the server is only configured to listen on named pipes so it only works with server name. The client will eventually find named pipes in it's list of protocols to use.
To test, replace servername with np:servername and tcp:servername to change the protocol without using the alias.
Or check what the server is listening on and fix that...
The other option is a non-standard TCP port (server, not 1433) or firewall preventing access to port 1433/1434.
SQL 2000 Books
Does the alias specify a protocol? Is that protocol accepted by the server? Is that the protocol being used when you are connecting by name? (i.e. what is the order of client protocols)

Change default port when registering a new SQL 2000 server

I'm trying to register an externally hosted SQL 2000 server through Enterprise Manager which isn't on the default port and I can't see anywhere to change it within Enterprise Manager.
So, the question is, how do I connect to the database if:
I.P. Address is 123.456.789 (example)
Port is 1334
I found this via Google:
You add a comma and the port number to the end of the server name.
So if you want to connect to MySqlServer.MyDomain.com on port 3821, you type...
MySqlServer.MyDomain.com,3821
Rob is correct - I have a SQL 2000 server running on the non-default port on a different instance name and the way I access it is like this:
[ip or dns name]\[instance], [port]
example:
my.server.com\MSSQLSERVER2, 12345
You don't need \\[instance] if you used the default sql server instance when you installed.

Resources