Sat 6 Oct 2007
Useful Cacti Templates to Monitor Your Servers
Posted by Scoundrel under Admin-tips , Databases , DevelopmentRecently 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. ![]()
- Found an Ideal I/O Scheduler for my MySQL boxes
- Typical use-cases of mmm-deployment
- How to run GUI-programs on a server without any monitor
- Master-master replication example
- Master-Master Replication Example using MMM
2007-10-06 at 12.49 pm
Thanks for tips,I had both graphs fully working now, 1 year later
2007-10-06 at 5.42 pm
I struggled with cacti for the longest time, as I found it isn’t very scalable with 100’s of servers; the templates and graphs, as you stated can be cumbersome. Then I found OpenNMS (www.opennms.org) which is much better. It’s like Cacti and Nagios combined.
I recommend it over Cacti any day.
2007-10-07 at 4.26 pm
Thanks, man, this is extremely valuable info!
Setting monitoring for Tomcat/Apache/Mysql/Disk IO…
If you want - I’ll share the templates once I have it forking
2007-12-17 at 9.57 pm
would you please share how to monitor the tomcat with cacti? I have looked the solution for a while and could not find it.
my email is hli9@yahoo.com
Thank you!
-Hank
2008-04-28 at 12.43 am
[...] You may also be interested in Alexey Kovyrin’s list of templates for monitoring servers.Technorati Tags:Alexey Kovyrin, Cacti, Cacti templates, graphing, monitoring, mysql, Rimm Kaufman [...]
2008-07-07 at 4.44 pm
[...] Useful Cacti Templates to Monitor Your Servers [...]