Skip to content

A bash script to send email notifications if it cannot curl or/and ping a host.

License

Notifications You must be signed in to change notification settings

KeepSec-Technologies/KPing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

KPing

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.

Prerequisites:

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!

What's next:

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!

image

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: image

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.