Skip to content

I made this as a tool for easily checking if my AWS instances are down. Lighsail does not provide a very easy method for doing this so I came up with my own

Notifications You must be signed in to change notification settings

deus-avertat/instance-pinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instance Pinger

This is a ip/domain pinger made in GoLang that sends an alert email on failed pings.
I primarily use this for keeping track of my AWS Lightsail instances as they go down often.

Usage

In the json folder is where your settings are located.
The smtp.json contains the smtp settings. Put your mail providers settigns in here.
The instances.json is where your domains/ip's go. You need to assign a name to your domain aswell.
For more settings read the README.md in the json folder.

Setup

Windows

If you are on Windows this script should work without any modification. If you are having trouble/failing ICMP on the pings
then you can try running as admin, other wise jump into the main.go and CTRL+F the line pinger.SetPrivileged(true) and
comment it out

Linux

Same as above should apply but if you are having issues with ICMP pings you should jump into the main.go and CTRL+F
the line pinger.SetPrivileged(true) and comment it out. Then in your linux shell set the following option

setcap cap_net_raw=+ep /path/to/your/compiled/binary

If you are encountering other problems with the pinging function have a read through the library's installation and supported operating
systems section in the README.md @ Go-Ping

TODO

  1. Split instance ping and domain ping into different sections so it isn't as messy. i.e, instances.json only contains the addresses for the direct instance.
    I will add a domains.json file where websites/domains can be stored and then the script will do two pings, one on the actual instance servers, and then
    another on the domains/websites. I will then make the email have 2 sections, one for instances and one for domains.

About

I made this as a tool for easily checking if my AWS instances are down. Lighsail does not provide a very easy method for doing this so I came up with my own

Resources

Stars

Watchers

Forks

Languages