nagios -v not counting all warnings

Jim Avery jim at jimavery.me.uk
Mon Dec 21 16:59:42 CET 2009


2009/12/19 Jim Avery <jim at jimavery.me.uk>:
> 2009/12/17 Ton Voon <ton.voon at opsera.com>:
>
>> Can you get a minimal config that displays this behaviour? I'll add it
>> to the tests in CVS.
>
> Yes I will do in the next few days.  I'm sorry I didn't have any spare
> time yesterday.
>
>> Should it be counted in the warnings or is it just an informational
>> message?
>
> If it were just informational, I suppose you could simply change the
> "Warning" to "Information" and have done with it.  Personally I'd
> rather it remain a warning (and gets counted) as it does point to a
> genuine mistake in the config.

Okay here's the minimal config (I'm assuming you already have simple
templates for generic-host and generic-service):

define command{
        command_name    check_dummy
        command_line    $USER1$/check_dummy $ARG1$
}
define hostgroup{
  hostgroup_name  test
  alias           test - hosts used for testing
}
define host{
  use             generic-host
  host_name       test
  alias           test - Host used for testing new service checks in Nagios
  address         10.123.123.123
  hostgroups      +test
  parents         localhost
}
define service
  host_name             test
  use                   generic-service
  service_description   test
  check_command         check_dummy!0 "test always succeeds"
}
define service
  host_name             test
  use                   generic-service
  service_description   test
  check_command         check_dummy!0 "test always succeeds"
}



When I run nagios -v against a nagios.cfg which reads this config, I get:

  Warning: Duplicate definition found for service 'test' on host
'test' (config file '/usr/local/nagios/etc/objects/test/services.cfg',
starting on line 1)

which is fair enough as the service is indeed defined twice, but in
the totals at the end I get:

  Total Warnings: 0
  Total Errors:   0

Note this behaves the same whether the second service is defined using
directive "host_name test" or "hostgroup_name test".


hth,

Jim

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 



More information about the Developers mailing list