Hello,
New Nagios user here with an override question. For reference, I am using Nagios 3.2.0. I am trying to do a ping check override for different host groups. Here is an example that isn't working as expected:
define service {
use generic-service
service_description Ping Check
check_command check_ping!32,80%!40,90%
host_name *
}
define service {
use generic-service
service_description Ping Check
check_command check_ping!180,80%!200,90%
hostgroup_name apc-devices
I want all hosts to test ping with the 32,80!40,90 parameters except for the hosts defined in the apc-devices host_group. These should use the 180,80!200,90 parameters. The actual behavior is that the apc-devices are using the 32,80!40,90 parameters. In effect, the override isn't working. Am I doing something wrong or is this not supported?
Thanks
Joe
hostgroup_name override not working service?
Re: hostgroup_name override not working service?
It all depends on the order the configs are loaded. The check has the same name, so whichever one is loaded last will take precedence, overwriting the other. You can check which one is applying by searching through the objects.cache file
Code: Select all
more /usr/local/nagios/var/objects.cache
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: hostgroup_name override not working service?
Thanks for the reply. I checked the objects.cache file as you suggested and as expected the apc-devices are using the first set of parameters. No surprise as this reflects the problem that I am seeing.
The examples I provided are in the same config file in the same order that I listed them so I would expect the second to override the first. This is working great when I use a host_name to override a previously define command applied to a host_group but it is not working when I specify a host_group to override a previously define command applied to a host_group.
Can anyone confirm or deny that what I am attempting to do is supported?
Thanks!
The examples I provided are in the same config file in the same order that I listed them so I would expect the second to override the first. This is working great when I use a host_name to override a previously define command applied to a host_group but it is not working when I specify a host_group to override a previously define command applied to a host_group.
Can anyone confirm or deny that what I am attempting to do is supported?
Thanks!
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: hostgroup_name override not working service?
There may be certain scenarios where this will work, but as a whole I would say it is unsupported and will likely throw warnings of duplicate definitions when verifying your configuration.joehayden wrote:Can anyone confirm or deny that what I am attempting to do is supported?