Kevin Metz <[EMAIL PROTECTED]> writes:
> I'm looking to extend the ganglia monitoring just a
> little. Since I have all the data, I'm wondering if there's a
> way to get something to e-mail me if say for example, the
> max_partition on a machine exceeds 90%. I'm guessing I could
> put a cron job that looks at a certain file, or telnets to a
> port? I'm not real good at this kinda stuff so I was looking
> for some help, or maybe someone else has done this before.
Here's a suggestion that I believe might be feasible if you're
familiar with some fairly basic Perl coding... You could leverage
the output of the gmetad as input to another monitor that would do
the checking and alerts. This would be a pretty clean division of
labor.
An example might be to use the Open Source monitor package "Mon".
Mon is basically a "scheduler" that invokes monitor plug-ins,
typically written in Perl.
For this to be entirely robust, you might need to employ a formal
xml parser, of which several already exist. However, you may be
able to cut some corners here and depend on gmetad's well-behaved
output and parse the output directly using simple hash arrays.
So, it might work like this:
-Mon invokes monitor to check diskspace.
-the monitor reads the current data from gmetad, parses out disk
space info for each host; if any value is above threshold, Mon
alerts using the std monitor conventions (exits with non-zero
status, with description). Mon would take care of things like
alert throttles, etc.
I already use Mon, so if I get time I may write a monitor template.
If you get Mon up and running, I'll be happy to share the Mon
monitor script to test the theory. As a hint, look at the
tcp.monitor in the mon.d directory of the Mon distribution.
Jerry