Cacti stats for a Drupal Site

Events happening in the community are now at Drupal community events on www.drupal.org.
raintonr's picture

I was thinking about trying to monitor several Drupal metrics using Cacti and went looking for someone who's done it before. Doesn't seem so, but I would have thought monitoring statistics on your site(s) is an essential part of any high performance setup so bring it up here.

Anyhow - found something similar only and added a comment over on a thread about monitoring Drupal:

http://groups.drupal.org/node/20271#comment-74657

Anyone here interested in such an effort and how it might be built?

Comments

Munin too?

kbahey's picture

Munin also outputs RRD files. Wriing and extension is trivial. I have one running less than 30 minutes.

The Munin plugins could query the database for number of nodes, users, comments, and pretty much anything else that can be gleaned from Drupal's database.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

Drupal Module?

raintonr's picture

Cool... did you produce a Drupal module to output stats then? Or are you talking about a small script that just grabs stats you need out of a local database and runs as part of Munin?

What I had in mind would have to run as a module as it would have to be queried remotely based on the Drupal site name.

Outside of Drupal

kbahey's picture

Munin works by executing plugins in a specific directory. They can be written as shell scripts, perl or anything else.

So, I have done them the Munin way.

If you want something from within Drupal, then check the Drupal Nagios integration module, which I wrote. It makes Drupal query-able from Nagios.

Another thing to watch is this Google Summer of Code project, which aims for something similar, within Drupal http://groups.drupal.org/node/20889

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

When having a (virtual) root

Alexander Langer@drupal.org's picture

When having a (virtual) root server you might easily be able to write your own Munin or Cacti extension, grabbing data directly out of the database.

A more general approach would be to write a Drupal module that delivers statistics upon requests and provides hooks for extensions. It would also have to do some authentication, at least by defining which IP address may grab statistics (similar to how munin's nodes are configured).

To not reinvent the wheel you'd watch out for something to build upon. Services and webservices modules come into my mind, though I haven't worked with them by now.

I'd be interested in helping out where I can. I'm using Munin on all of my servers and know Cacti only from some demos as well as from killes' going through some of drupal.org's stats, but as Khalid said both use a similar data format.

Alex

I use Cacti & Drupal

slurpee's picture

Check out http://drupalcampchicago.com/cacti

login - public
pass - public

I have been trying to setup as many graphs as possible for Drupal related services. The hardest part is enabling and configuring SNMP on the server. Most Drupal users don't have access or the knowledge how to set it up.

Google created some great MySQL graphs - http://code.google.com/p/mysql-cacti-templates/

I could on about this for awhile. Contact me if you need some help or want to work together.

I'd love to follow your

stewsnooze's picture

I'd love to follow your work. Hopefully I can help at some point. We are attempting to do a similar thing

Full Fat Things ( http://fullfatthings.com ), my Drupal consultancy that makes sites fast.

Wanted more Drupal Specific Stats

raintonr's picture

@slurpee - Yeah, those stats you show are all host/DB specific things and am already using most of them.

Useful as this is I was thinking that more Drupal specific stuff like nodes/users/comments/cache hits/etc/etc. would be good too and that's what I was posting about.

Cheers,

Rob

What stats do you want

webmasterkai's picture

I'm working on some drupal/cacti graphs with Dmitri Muntean. What graphs are you interested in? I'd be happy to finish up what we have and submit it.

I've got things like:
guests on site now
authenticated on site now
total users
new users in last month

That sounds brilliant, i've

a_c_m's picture

That sounds brilliant, i've just spent 6 hours re-grok'ing cacti and once i saw how the plugins worked that was my first thought.

Perhaps also new nodes and new nodes of a given type, new users, new users by role, total users, emails sent, comments left ... the list goes on!

More stat ideas

raintonr's picture

Fantastic offer. Stats to consider:

  • Pages built (and loaded from cache)
  • Blocks built (and loaded from cache where block cache is there)
  • Views built (and loaded from cache) where views are enabled
  • Total page generation time. Divide by page views to get average.
  • Someone else has mentioned nodes created. What about comments when that module is in use?
  • CAPTCHAs displayed/passed/failed where CAPTCHA is enabled.
  • and on and on and on ;)

Did you end up submitting

a_c_m's picture

Did you end up submitting the code?

I'm not going to get a chance to look at this again till next month, but will share any metrics / modules that come out of our work on it.

how to find drupal snmp data?

slurpee's picture

How are you finding the snmp data to collect related to Drupal?

Which OIDs are you utilizing?

Do you have anything I can try via snmpwalk?

SNMP Drupal

raintonr's picture

There won't be any. We'll have to make up our own custom OIDs.

For anyone thats interested,

a_c_m's picture

For anyone thats interested, this is quite a good little tutorial on creating a custom graph - it gives a nice insight into creating your own graphs (and is a handy tool in its own right).

http://www.askaboutphp.com/tutorials/44/cacti-using-cacti-to-monitor-web...

@webmasterkai any updates?

I'm also very interested in

mrfelton's picture

I'm also very interested in this.

--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.

Cacti

rjbrown99's picture

Here's what I am doing for Drupal-related Cacti graphs at the moment.

PALMV3. I'm using the APC graphs from this package.

Memcache I'm using this multiport memcache since I split up the bins across numerous instances of memcache.

Apache Solr. I'm using their template and a new data collection script which I ported to work the Solr 1.4.

Varnish. I'm using the "version 3" template.

Better Cacti Templates. I'm using their Apache, InnoDB, and MySQL templates.

This has me covered at the MySQL, Memcache, HTTPD, Solr, APC, and Varnish levels for stats. What I have yet to find are released Drupal+Cacti templates as referenced above. I did send a note to webmasterkai asking for his started templates. I already have Google Analytics and log analysis, what I'm now looking for are direct-from-the-db stats such as:

  • Authenticated user count vs. guests (plotted on the same graph)
  • Total nodes in the system, plotted across content types (i.e. one line for each content type)
  • Total users + new users
  • Hits to a specific path I created in a custom module (a hook_menu path) plotted by authenticated user vs guest.
  • LOTS of stuff related to Feeds (items imported vs updated per feed node, etc)

The goal of some of this is to focus efforts on where specifically to performance tune the stack since authenticated vs. unauthenticated is a big part of that.

Not much activity here in the past year. Anyone else interested in helping roll some of this?

Still interested

slurpee's picture

Maybe we can setup an IRC meeting to discuss these topics?

Sure

rjbrown99's picture

Sure, how about popping in to #drupal-cacti when you have a chance? I'll leave a client running and perhaps we can catch up.

Project

rjbrown99's picture

I started on this today. Project is here:
http://drupal.org/project/cacti

As I write this, I committed into HEAD an initial module that acts as a Cacti data input method. Basically this is the part that runs on the Drupal site and provides raw output to enable it to be graphed. Still to-do are the client side and then templates. I'd love some help, please pop in to the issue queue. The goal is to enable this to be a flexible way to graph just about anything from a Drupal site. Right now I just started with logged in users vs. anonymous users.

So which one is better? I'm

everyz's picture

So which one is better? I'm using Munin and never tried out Cacti. Should I?

Collectd!

brianmercer's picture

Collectd!

Cacti project

yourix's picture

Really good idea,
I will give it a try really soon.

Thanks

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week