This a little something I found useful at work, I needed to compare ping times at a resolution of 1minute. I found Cacti and the Advanced ping template for this invaluable.
Operating system, ubuntu 9.10 (will also work with Debian)
From a terminal:
#sudo apt-get install snmp cacti php5 mysql-server apache2
After downloading the packages you will be asked to setup a root password for mysql (if not previously installed)
For webserver type select apache2
Answer yes to allow database-config to setup access for cacti, cacti will ask you for a database password leave it blank and it will create a random one for you.
Now when all the packages have installed go to http://localhost/cacti and follow the instructions for new install.
You should be presented with a login screen, use admin and admin (you will be then asked to change the password)
cacti_graph_template_ping_advanced_ping_v1_3.zip by TheWitness
Extract the zip file and within the cacti admin page select Import Templates, click browse and select the cacti_graph_template_ping_advanced_ping_v1_3.xml file and click save.
You are now ready to start monitoring something 🙂
Goto Data Templates in the cacti admin page and select PING – Advanced Ping v1.3, change the step to 60 and then change the heartbeat to 60 and the max to 2000 for avg dev loss max min (i had to press save each time)
edit the cron job to make the poller to run every min as root
#sudo nano /etc/cron.d/cacti
change */5 * * * * www-data php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
to read * * * * * root php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
and restart cron with
#sudo restart cron
Next go to settings in cacti and the poller tab, change the Poller Interval and Cron Interval to 1min, and change the host down detection to none.
Go to devices and then add, i’m using google as my host so type in www.google.co.uk as the IP, then click save now go to new graph and select your device and under graph template create “PING – Advanced ping 1.3” and click create.
Chose what kind of ping you would like ICMP, TCP or UDP and click create again and after about 5 minutes you graph should appear in the graph management view.