Monitor CF using Nagios: a useful new way
Note: This blog post is from 2009. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.Nagios is an open source (Linux based) monitoring tool that many organizations use to monitor their IT infrastructure. Here are two resources to help you monitor it with CF, one of which is a new way that may give additional benefit to those already doing Nagios monitoring of CF.
Basic CF Monitoring in Nagios
First let me share that if you've not explored monitoring CF with Nagios at all, here's at least one blog entry from 2005 discussing that. (A more recent one, at http://profec.net/2009/01/12/monitoring-coldfusion-with-nagios/, which I used to list here, is no longer responding, nor could I find it on archive.org.)
Of course, you can easily use Nagios primarily to report whether CF's up or down, but you can also monitor basic statistics such as are provided via CFSTAT (also available on Windows via Perfmon, which also exposes generic stats about all processes), as demonstrated in that blog entry.
But you may have noticed that, if you run the Multiserver (multiple instances) version of CF, those CFSTAT and Windows Perfmon Stats aren't available on that version of CF.
So what to do if you wanted to monitor more about what's going on inside of CF?
FusionReactor Nagios Plug-in
If you're running FusionReactor Enterprise, you can now get that additional information via the free FusionReactor Nagios Plugin. It's a perl app that when implemented will expose certain key statistics in a way that Nagio can process them (and some are things that CFSTAT and the CF Permon stats don't report):
- Count of current running requests, and total count of all requests run
- Count of request queued by FusionReactor
- Average request runtime (since server start), and Recent request runtime (in past 60s, by default)
- Count of recent slow pages
- Memory free in bytes and percentage
- Memory Total and Max
- Instance and System CPU Use percentage
- Count of recently completed JDBC requests
Note that this is technically community-contributed feature (from an Intergral employee, David Stockton), not a supported feature.
If you're running or are interested in FusionReactor Enterprise, check it out.
For more content like this from Charlie Arehart:Need more help with problems?
- Signup to get his blog posts by email:
- Follow his blog RSS feed
- View the rest of his blog posts
- View his blog posts on the Adobe CF portal
- If you may prefer direct help, rather than digging around here/elsewhere or via comments, he can help via his online consulting services
- See that page for more on how he can help a) over the web, safely and securely, b) usually very quickly, c) teaching you along the way, and d) with satisfaction guaranteed
- GETs an XML document
- XPath to XML value/attribute
- compare with WARN/CRIT value
- output result
As such, it can be used with FR2.2.
Having said that, a couple of things to note...
- I recommend upgrading to FR3 - it gives better performance and more features; plus if you purchased a maintenance option with your copy of FR2.2, it could be a FREE upgrade!!
- I haven't tested with FR2.2
- FR2.2 will not expose all the same XML properties; however basics like request count, CPU & memory should be available
If you're having issues with FR2.2 and the plugin then send me an email and we'll see what I can do.
Thanks for the support
D!
BTW, should anyone come along and be a little confused, I think Matt was referring to 2.0.2 (when he called it 2.2) and while Dave didn't correct him, it didn't even strike me as odd when I first read Matt's comment over the weekend. But to be clear, there was no 2.2 of FR. After 2.0.4 was 3.0 (and now 3.0.1). Anyone can correct me if I'm wrong. Just trying to avoid confusion from a future reader of these comments.
./check_fusionreactor -H localhost --port 80 --path /fusionreactor -l Administrator --password x --field /FusionReactorFederatedDataTransfer/SerializedMetrics/MemoryProbe/Total -c 90 -w 80
FusionReactorFederatedDataTransfer
500 Server closed connection without sending any data back http://www.w3.org/TR...
Handler couldn't resolve external entity at line 1, column 108, byte 108
error in processing external entity reference at line 1, column 108, byte 108:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...">
===========================================================================================================^
<html xmlns="http://www.w3.org/19...">
<head>
at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/XML/Parser.pm line 187
I did offer a link to another blog entry that discussed another means of monitoring CF from Nagios. While that link seems now broken, I just updated it with another, though it's even older.
I would propose instead that you should visit the Nagios site, to either learn how to do create one yourself (which should be fairly easy, as Nagios is extensible) or perhaps there's a place there where you can ask others to build one for you. Hope that's helpful.