Welcome to the repository for my Ping Monitor project. This tool is designed to monitor the status of multiple IP addresses by pinging them simultaneously. It's a project that I've put together rather quickly and then adjusted to add more functionality.
The Ping Monitor should install automatically on any Debian-based Linux system. It has been tested on:
- Ubuntu 22.04
- Ubuntu 18.04
For other systems, you will need to ensure that the following dependencies are installed:
- lighttpd
- Python
- Flask
- SQLite
The setup is intended to work out-of-the-box on my specific system configuration, and might require some adjustments to work on yours. The included setup.sh script facilitates the installation and setup process by setting up everything needed to run the Ping Monitor as a service.
To install, follow these steps:
chmod +x setup.sh
./setup.shThis will install all the necessary packages and start the service on port 8010. You can access the service via http://localhost:8010 or http://yourserverip:8010.
Before configuring the ping targets, stop the service:
systemctl stop multiping.serviceNavigate to the multiping directory created by setup.sh. It should be in the same directory as your setup.sh script.
-
Edit Network Interface: Open
app.pyin your preferred editor (e.g., nano, Notepad++, or Visual Studio Code). Find thePingMonitorclass and locate the line:def __init__(self, ip_addresses, interface="br0", interval=1):
Replace
"br0"ininterface="br0"with your actual network interface (e.g.,enp1s0,wl0, etc.). -
Configure IP Addresses: Locate the section where IP addresses are defined:
ip_addresses = [{'ip': ip, 'name': ip} for ip in ['1.1.1.1', '2.2.2.2', ...]] for ip_address in ['1.1.1.1', '2.2.2.2', ...]:
Replace the example IP addresses with the ones you wish to monitor. Ensure the format follows the pattern
'ipaddr1', 'ipaddr2', ....Make sure both sections are updated and match in terms of the IP addresses listed.
-
Change Service Port: If needed, change the port on which the service runs by editing the line at the bottom of
app.py:app.run(host='0.0.0.0', port=8010)
Replace
8010with your desired port number.
Restart the service with:
systemctl start multiping.serviceAccess the Ping Monitor via http://localhost:specifiedport or http://yourserverip:specifiedport.
Initially, each container will be named after the IP address it is monitoring. You can change this name by clicking on the address and entering a new name. This updates the database and retains the change in memory.
Your Ping Monitor is now set up and ready to use. Enjoy monitoring your IP addresses with ease!
