[Xymon] best way to check amazon ec2 instance's availability

Jeremy Laidman jlaidman at rebel-it.com.au
Fri Nov 1 16:14:59 CET 2013


On Nov 1, 2013 10:50 PM, "deepak deore" <deepakdeore2004 at gmail.com> wrote:
>
> As ec2 instances by default doesn't respond icmp and I dont want to
enable icmp and ssh access to xymon server, what could be the best way to
check the instance's availability.

Can you attempt a connection on an unused port (eg 443 or 25) and see if
you get an "ICMP port unavailable" message indicated by a "connection
refused" result in netcat? That should be as effective as a ping.

> Currently in my env i m doing following to check the availability:
>
> 1. Created server ext script which connects to bastion host and from
there it checks the ssh connection to the server.
>     ssh -n bastion_host "nc -w 5 -vz ec2_instance 22" 2>&1
>          if [ $? -eq 0 ]; then
>              COLOR=green
>           else
>              COLOR=red
>          fi

Perhaps if the ssh fails to connect to the bastion you can set the color to
"clear", and just make sure you bastion host is monitored.

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20131102/3480f1f4/attachment.html>


More information about the Xymon mailing list