[Pkg-nagios-devel] Bug#545940: check_ircd: argument handling

Hendrik Jaeger henk at hnjs.de
Thu Sep 10 20:24:40 UTC 2009


Hi Jan,

On Thu, 10 Sep 2009 10:10:06 +0200
Jan Wagner <waja at cyconet.org> wrote:

> > The check_ircd plugin works just fine using the commandline using
> > this command: /usr/lib/nagios/plugins/check_ircd -H localhost -p
> > 1984

> Unfortunately I can't reproduce your effect:
> 
> nagios:~# /usr/lib/nagios/plugins/check_ircd -H 'irc.freenode.org' -p
> '6667' Critical Number Of Clients Connected : 6456 (Limit = 100)
> nagios:~# /usr/lib/nagios/plugins/check_ircd --hostname
> 'irc.freenode.org' -p '6667'
> Critical Number Of Clients Connected : 6456 (Limit = 100)
> nagios:~# /usr/lib/nagios/plugins/check_ircd 'irc.freenode.org' -p
> '6667' Critical Number Of Clients Connected : 6457 (Limit = 100)

I'm sorry, I phrased that so unclearly.
That's what I meant to say: It works just fine in a shell with any
combination of arguments/options I tried. No problem so far.

> > Configuring this command for nagios:
> > command_line    /usr/lib/nagios/plugins/check_ircd -H
> > '$HOSTADDRESS$' -p '$ARG1$'
> >
> > This check will return an UNKNOWN state in nagios with an error
> > output: "invalid port: -H"
> >
> > The same happens with other constellations.
> > The solution i found on the web was to remove '-H' so that the
> > command looks like:
> > command_line    /usr/lib/nagios/plugins/check_ircd '$HOSTADDRESS$'
> > -p '$ARG1$'

> Could you please be more verbose?

My command definitions:
----snip----
define command {
  command_name    check_ircd
  command_line    /usr/lib/nagios/plugins/check_ircd '$HOSTADDRESS$'
$ARG1$
}

define command {
  command_name    check_ircd_fail
  command_line    /usr/lib/nagios/plugins/check_ircd -H '$HOSTADDRESS$'
$ARG1$
}
----snap----

And this are the services using those commands:
----snip----
define service {
  host_name               localhost
  service_description     IRCd
  check_command           check_ircd!-p 1984
  use                     henk-stdsrv
  notification_interval   0
}

define service {
  host_name               localhost
  service_description     IRCd-fail
  check_command           check_ircd_fail!-p 1984
  use                     henk-stdsrv
  notification_interval   0
}
----snap----

The first one reports the service as OK:
IRCD ok - Current Local Users: 17

While the second says UNKNOWN:
Invalid warning threshold: -H

When i make the following change in both service definitions, both
report OK with the above mentioned message:
check_command           check_ircd!-p 1984 -w 55 -c 80

Note that all of those commands work just fine in a shell, just not in
nagios. But as i now tested only when the embedded perl interpreter is
used implicitly. So I guess this bug can be closed or perhaps
reassigned.

Sorry for the trouble.

Best regards

Hendrik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20090910/b78128d2/attachment-0001.pgp>


More information about the Pkg-nagios-devel mailing list