Cacti – Advanced Ping

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)

Now download  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.

😀

Advanced Ping to google

Cacti + Advanced Ping

cacti ping advanced

4 Thoughts on “Cacti – Advanced Ping

  • This looks pretty cool Adam. Do you know if it’s possible to recieve alerts based on criteria such as packet loss? I’m looking for a tool to monitor webservers and alert me if they become unresponsive. A bash script would do it but this looks possibly better. Cool blog by the way!

    Thanks 🙂

  • You want to take a look at Nagios, I have also set this up for work and monitor over 300 items and can send SMS alerts.
    I will be happy to setup a basic system for you, just let me have access to a linux box or i could set something up on a Sun VM for you.
    And if its going to be used for a commercial purpose you could throw some beers my way 😀

    Adam

  • Hehe, i have complied nagios from scratch, good luck.
    Give me a shout if you want SMS alerts this can be done with a nokia phone.

Comments are closed.