Ideally, you would put this in a Raspberry Pi. However, it supports on anything that can run Python and pip. This program will ping three different IP addresses and get the average RTT value in milliseconds. The values are then stored onto Ubidots for record keeping and analysis.
It is recommended that you install this under root user. This is because to send an ICMP packet, you need root privilege.
- Ubidots account (app.ubidots.com)
- Pipenv
- Root privileges (to send out ping/ICMP packets)
- Clone the repository.
- Run
pipenv install
. This will install all the Python modules that the program will need. - Login into your Ubidots account and copy the API key.
- Create a device and FOUR variables with one for the Hearbeat variable (choose the default variable if you are not sure) .
- Copy down all the variable ID.
- Edit the configuration file by typing
nano config.py
(refer to config.py.example) - Insert the appropriate API key and variable ID.
- Test the program by typing
python isp_report.py
- Your results should be available on the dashboard on Ubidots.
Now we need to make it run periodically. Since it needed root privilege, you need to make sure to run it as root.
- Review the
cron.txt
and edit the path to point to the program. Also, edit the interval as you like. The deault is set to report every minute. - Run
crontab cron.txt
to install the cronjob from the cron.txt into your machine. - Observe Ubidots and make sure that your data is coming in.
To detect downtime and visualize your data, you would need to configure Ubidots dashboard a bit.
- Go to the dashboard section and create three graphs. This will be for your RTT value visualizations.
- Go to Events section, configure so that if the Heartbeat variable is inactive for X minutes, set itself to ZERO.