This bash script makes a cronjob to notify you when one of your hosts is down by curling and/or pinging via user inputs prompts to make the configuration as easy as possible.
1) Being logged in as root or super-user
3) An internet domain pointing to your server, I recommend installing an SPF/DMARC record to pass through some email provider when sending your notifications.
That's it!
1) Install the KPing.sh file and make it executable.
To install it:
wget https://raw.githubusercontent.com/KeepSec-Technologies/KPing/main/KPing.sh
To make it executable:
chmod +x KPing.sh
2) Then run:
./KPing.sh
3) Answer the questions like the image below and you're good to go!
And we're done!
The cronjob is in /etc/cron.d/kping-[DOMAIN]-job
The cronjob logs is in /etc/KPing/logs
If you want to remove only the configurations re-run the script and it will ask you for this:
If you want to uninstall completely it do:
rm -f /etc/cron.d/kping-*
rm -fr /etc/KPing
Feel free to modify the code if there's something that you want to change.