Tool to Calculate 'Effective' Config for a Host or Service?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kjhosein
Posts: 7
Joined: Wed Jul 03, 2013 7:18 am

Tool to Calculate 'Effective' Config for a Host or Service?

Post by kjhosein »

Hello all,

I looked around my Nagios Core & Nagios XI interfaces, but can't find a mechanism or a tool that would show me or calculate the 'effective' config for a host or service. This would be particularly useful where you make use of templates, especially nested templates.

I searched through the Nagios Exchange, and as you can imagine, this is a tough thing to search for given the keywords!

Am I blind and if not, does such a tool exist?

Thanks!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Tool to Calculate 'Effective' Config for a Host or Servi

Post by slansing »

I'm not quite sure what you mean by the 'effective' config for a host. Could you be a little more specific on what exactly you are looking for? Or to do?
kjhosein
Posts: 7
Joined: Wed Jul 03, 2013 7:18 am

Re: Tool to Calculate 'Effective' Config for a Host or Servi

Post by kjhosein »

Taking an example out of http://nagios.sourceforge.net/docs/3_0/ ... tance.html, let's say you have a couple of definitions where one 'uses' the other, template style:

Code: Select all

define host{
		host_name		bighost1
		check_command		check-host-alive
		notification_options	d,u,r
		max_check_attempts	5
		name			hosttemplate1
		}

define host{
		host_name		bighost2
		max_check_attempts	3
		use			hosttemplate1
		}
Then the config for bighost2 would effectively be:

Code: Select all

define host{
		host_name		bighost2
		check_command		check-host-alive
		notification_options	d,u,r
		max_check_attempts	3
		}
What I want 'to do' is see those calculated configs for a host or service.
Thanks!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Tool to Calculate 'Effective' Config for a Host or Servi

Post by abrist »

You can see the current, 'effective' objects by looking at the objects.cache file:

Code: Select all

less /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.
kjhosein
Posts: 7
Joined: Wed Jul 03, 2013 7:18 am

Re: Tool to Calculate 'Effective' Config for a Host or Servi

Post by kjhosein »

Great, thank you!

Would be nice to have it in the GUI, but I'm not complaining! I'll take it :D
Locked