2

I've got some NT boxes located on EC2 that I'd like to monitor. The problem is that the Nagios box needs to know an IP address it can connect to in order to do the monitoring, and the IPs of the instances change every time they start.

Is there a good way of doing this or am I going to be forced into writing a program that will poll EC2's API?

1
  • // , Good question, although if I was to read the title alone, I would get the impression that it is sort of a matter of opinion. Can you make it a bit more specific, perhaps? Or at least change the title to something like "How do I set up static access points in EC2 for Nagios to monitor?"? Jul 21 '15 at 1:47
4

You can use Dynamic DNS. Install a Dynamic-DNS client on every one of your servers and the IP will be updated when it changes.

You'll have to configure Nagios with hostnames instead of IPs. Probably you want a low TTL on the DNS server to avoid the old IP being cached too long.

1
  • // , Now that is the clever way to do it, for sure. Jul 21 '15 at 1:48
5

You can look in to Elastic IPs if you need static IP addresses. These are IPs owned by your AWS account that you can assign to any instance you run.

Elastic IP addresses are static IP addresses designed for dynamic cloud computing. An Elastic IP address is associated with your account, not a particular instance, and you control that address until you choose to explicitly release it. Unlike traditional static IP addresses, however, Elastic IP addresses allow you to mask instance or availability zone failures by programmatically remapping your public IP addresses to any instance associated with your account.

1

We use Nagios for monitoring our Windows instances on EC2:

  1. Get Elastic IPs (you need static IP addresses).

  2. Open ping in the EC2 firewall (blocked by default)

  3. Done!

1
  • Hi Frank. How do you handle Auto Scaled instances in Nagios? For example, if we have two instances I1 and I2 for App1 and nagios is monitoring service s1 and s2 for App1. Now, if it auto scales to third instance I3. In this case, how does nagios know I3 belongs to App1 and it should monitor onlly s1 and s2. Mar 28 '18 at 17:32
0

Groundwork Open Source 6.4 has a Cloud Connector which uses the EC2 API to autodiscover and add/remove hosts - handy for app/websites which scale up and down.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.