[Nagiosplug-devel] Re: OF nagios plugins

Gavin Carr gavin at openfusion.com.au
Wed Jun 8 18:40:33 CEST 2005

On Thu, Jun 09, 2005 at 02:16:52AM +0100, Paul L. Allen wrote:
> Gavin Carr writes: 
> > - check_linux_raid, a generalised version of contrib/check_linux_raid.pl
> I had to hack that myself to deal with various things that /proc/mdstat
> did in more recent versions of Red Hat.  It's late now (and I have applied
> several glasses of de-stressing fluid) so when I get time I'll check what
> you've done and see if I've done anything you've missed and try to merge
> it in.  If that's too hard I'll send you mine and let you try to merge it
> in. :) 

The main thing I was after was the ability to check _all_ raid devices,
not to have to test them individually. The contrib one couldn't do that.

> > - check_qmailq - based on contrib/check_qmailq.pl
> At one point check_mailq added support for checking qmail queues.  If it
> worked properly it would be better to use that rather than having a
> separate plugin to check qmail queues.  Check_mailq added -W and -C
> options for checks on preprocessed messages as reported by qmail-qstat.
> Unfortunately, the way it used GetOpt::Long caused meant that -W and -C
> caused an error about about a conflict with -w and -W and a conflict with
> -c and -C with some versions of Getopt::Long.  Even more unfortunately, I
> believe a patch was submitted to "fix" the problem by removing the -W and
> -C options.  A better fix is to change -W and -C to (say) -p and -q.  An
> even better fix is to add the line "use Getopt::Long::Configure('bundling')
> (which is how check_ntp manages to work with upper- and lower-case options
> with versions of Getopt::Long that check_qmailq barfs on). 
> Another point with check_mailq is that the authors clearly tested it on a
> qmail installation that has Bruce Guenther's unofficial and unsanctioned
> qmail patches.  In particular, the installation had the patch that allows
> unprivileged users to run qmail-qstat (technically, it replaces the
> qmail-qstat shell script with a script that connects to a privileged
> daemon).  Installations that do not have the qmail-qstat patch will fail to
> work with check_mailq unless you setuid root on qmail-qstat or do some sudo
> magic.  This is undocumented in the plugin, so if you don't have the patch
> (or haven't applied it because you don't want ordinary users to see the
> output of qmail-qstat) then check_mailq will fail and you won't know why it
> fails for you even though it apparently worked for the authors. 

Yeah, I tried check_mailq first, but couldn't get it to work. The problem
I hit was that I'm typically using DAG's nagios-plugins RPM package, and 
that doesn't set $PATH_TO_QMAIL_QSTAT in utils.pm, which check_mailq requires.
I gave up on it when I couldn't figure out a way to fix that on multiple 
machines cleanly. Hardcoded paths in libaries (except maybe as defaults) are 
way dumb! How about adding an etc/nagios/plugins.cfg for such things, so 
that sites can override site-local settings like that?

> If those problems are fixed then check_mailq is a better way of doing it.
> If only because it means somebody else is maintaining it and you don't have
> to. :) 

Absolutely. :-)


More information about the Devel mailing list