Re: [Nagios-users] hostgroups and service dependencies?
Frost, Mark {PBG} wrote: > I'm just starting to get into service dependencies. My problem is that > I don't quite see how I can get around doing it individually for each > and every service and host needed. > > An example is if I've got 100 Windows servers all configured to be part > of a hostgroup. Then I've got a > > > define service { > hostgroup_name > prod_windows_servers > service_description NRPE Service > check_command NRPE Service > use Production > Windows Service > } > > define service { > hostgroup_name > prod_windows_servers > service_description CPU Load > check_command > check_windows_load!90%!90% > use Production > Windows Service > } > > define service { > hostgroup_name > prod_windows_servers > service_description C: Drive > check_command > check_windows_disk!C:!90%!90% > use Production > Windows Service > } > > where the 100 servers are all part of the 'prod_windows_servers" > hostgroup. Here I can list the checks nice and compactly and add new > hosts/checks merely by putting them in that hostgroup. > > I would like to make service checks on these boxes dependent on the > "NRPE Service" check above. So if the NRPE service was not responding, > Nagios wouldn't bother sending me alerts about all the other things on > that box it could not reach. > > The object definitions seem to say that I can do > > define servicedependency { > hostgroup_name > prod_windows_servers > service_description NRPE Service > dependent_hostgroup_name > prod_windows_servers > dependent_service_description C: Drive > execution_failure_criteria n > notification_failure_criteria w,u,c > } > > I'm assuming that this is supposed to match up each > 'prod_windows_servers' entry with its matching entry rather than making > each server dependent on this servers from *every* other hostgroup > member? > You assume wrong. This makes it depend on each hostgroup member. In order to do "same-host" dependencies, you can leave out one of the "hostgroup_name" or "dependent_hostgroup_name". I can't remember which, so go browse the docs to find out. Do note that same-host dependencies only work in Nagios 3. > Just to see, I tried this out and when I did a pre-flight check it took > 53 seconds (checking the host and service dependencies) when it normally > runs instantly. > Right. I'll try to apply the depth first search to host and service dependencies too. It was originally a patch from Jean Gabès, and it speeds up parent/child relations for hosts by a *huge* amount, so it's probably worth adding it to dependencies too. Even so, I'm guessing you actually added 100 (or more) times the number of dependencies you expected to add, so it's not surprising this eats a lot of CPU. -- Andreas Ericsson andreas.erics...@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Register now for Nordic Meet on Nagios, June 3-4 in Stockholm http://nordicmeetonnagios.op5.org/ Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] hostgroups and service dependencies?
The 53 second delay is natural - as nagios is calculating the dependencies and what it calls "circular dependencies " - meaning it check that the definition is correct and the logic you defined is fine . the delay will be there as long as you have the dependencies - as you are adding more complexity to the nagios operations and work logic - so it takes more time to prepare and create the "understanding " of the logic and requirements. creating 100 definitions of service dependencies will not reduce the calculation time , and will only make you have a more "mess" in the configuration , the way you set it up is correct , and more elegant to read and understand by the next guy that will need to take care of the system (if that ever happens ). On Wednesday 20 May 2009 19:35:20 Frost, Mark {PBG} wrote: > I'm just starting to get into service dependencies. My problem is that > I don't quite see how I can get around doing it individually for each > and every service and host needed. > > An example is if I've got 100 Windows servers all configured to be part > of a hostgroup. Then I've got a > > > define service { > hostgroup_name > prod_windows_servers > service_description NRPE Service > check_command NRPE Service > use Production > Windows Service > } > > define service { > hostgroup_name > prod_windows_servers > service_description CPU Load > check_command > check_windows_load!90%!90% > use Production > Windows Service > } > > define service { > hostgroup_name > prod_windows_servers > service_description C: Drive > check_command > check_windows_disk!C:!90%!90% > use Production > Windows Service > } > > where the 100 servers are all part of the 'prod_windows_servers" > hostgroup. Here I can list the checks nice and compactly and add new > hosts/checks merely by putting them in that hostgroup. > > I would like to make service checks on these boxes dependent on the > "NRPE Service" check above. So if the NRPE service was not responding, > Nagios wouldn't bother sending me alerts about all the other things on > that box it could not reach. > > The object definitions seem to say that I can do > > define servicedependency { > hostgroup_name > prod_windows_servers > service_description NRPE Service > dependent_hostgroup_name > prod_windows_servers > dependent_service_description C: Drive > execution_failure_criteria n > notification_failure_criteria w,u,c > } > > I'm assuming that this is supposed to match up each > 'prod_windows_servers' entry with its matching entry rather than making > each server dependent on this servers from *every* other hostgroup > member? > > Just to see, I tried this out and when I did a pre-flight check it took > 53 seconds (checking the host and service dependencies) when it normally > runs instantly. > > I'm not sure this does what I want. Even so, I don't know that I can > handle the 53 second wait which I imagine would escalate for each > service I defined in this way). The only other route I can think of is > to create a unique servicedepency definition for each of these. That's > 100 x n dependency definitions, where n is the number of other services > I'm checking on each of these boxes. > > Am I looking at this the wrong way? Is there an easier way to do this? > > Thanks > > Mark > > > --- >--- Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables > unlimited royalty-free distribution of the report engine > for externally facing server and web deployment. > http://p.sf.net/sfu/businessobjects > ___ > Nagios-users mailing list > Nagios-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagios-users > > ::: Please include Nagios version, plugin version (-v) and OS when > ::: reporting any issue. Messages without supporting info will risk being > ::: sent to /dev/null -- Assaf Flatto SSP Ops Team Linux System Administrator 169 Euston Road, London, NW1 2AE Along with a few colleagues I am doing The Three Peaks Challenge again this year to raise money for The Railway Children. Please sponsor me by making a donation online, simply click on the link below and give via your switch/credit card. Thank you. h