Useful Cacti Templates to Monitor Your Servers
6 Oct2007

Recently I had one customer for consulting and aside from mysql optimization, etc they asked me for cacti installation/setup to monitor their pretty generic LAMP application. I’ve started setting up all this stuff and I’ve never thought it could be so painful… lots of different templates for the same tasks, all of them are incompatible with recent cacti releases, etc, etc… So, this post is generally a list of used templates with a fixes I’ve made to make them work on recent cacti release.

Server Resources Monitoring

This was the simplest one because cacti itself has great SNMP polling code so I’ve just installed net-snmp (RHEL) packages on all of customer’s servers, set them all to work with some secret community and return all known OIDs and that was almost it – I’ve just needed to create an appropriate graphs using “ucd/net SNMP Host” device template. Just one thing I’d like to mentions here: for all non-SNMP devices I’d suggest you to put an empty string (remove a community name) from “SNMP Options” section. This would prevent monitoring from stop working because of SNMP problems (no community = disabled SNMP checks).

MySQL Monitoring

To monitor MySQL I’ve used teMySQL templates found here. After I’ve imported their templates and installed scripts I’ve found out that one of their graphs is not displayed: “Old Handler Stats” graph generation command for rrdtool returned “ERROR: invalid y-grid format”. To fix this problem, I’ve removed “Unit Grid Value” in “Console” » “Graph Templates” » “teMySQL – Old Handler Stats” and recreated (remove/create) this graph for MySQL hosts.

Memcache Monitoring

For this purpose I’ve used some template and script from the same package that has been used for MySQL. This one had a problems with “Count Stats” graph. To solve them I went to “Unit Grid Value” in “Console” » “Graph Templates” » “memcached – Count Stats” and clicked on items #4 and #5 to select appropriate “Data Source” values. Then, as always, recreated my graphs.

Apache Monitoring

This one was most annoying (too many different templates and weirdest bugs). To monitor our apaches I’ve used apachestats 0.4 templates with some fixes mentioned here. But anyways, there were two graphs that I didn’t managed to fix (some CDEFs format problems). If someone knows better plugins for this, I’d be really glad to hear.

If you have some other interesting links related to cacti-based monitoring, I’d be glad to hear about them and would really appreciate any new information related to this topic because I definitely sure that proper monitoring is the first step to successful scalability of any large project. We need to know what happens on our servers to know where we should start thinking about scaling out. 🙂