Page 2 of 2

Re: Hostgroups for specific users

Posted: Tue Jan 17, 2012 1:29 am
by TSCAdmin
Thanks Scott but this is what I already have:

Code: Select all

$ get_para '\+' hosttemplates.cfg

define host {
       name                                     data-hosts
       use                                      xiwizard_generic_host
       contacts                                 +data_team
       register                                 0
}

define host {
       name                                     xiwizard_windowsserver_host
       check_command                            check_xi_host_ping!3000.0!80%!5000.0!100%
       use                                      xiwizard_generic_host
       contacts                                 +nagiosadmin,servicedesk,tsc_windows
       register                                 0
}
and then in the real host definition I have

Code: Select all

define host {
        host_name                       us-ham-svv-0245
        use                             xiwizard_windowsserver_host,data-hosts
When I login as tsc_windows I can see this host but not when I login as data_team. Now when I reverse the use order in the host definition like this

Code: Select all

define host {
        host_name                       us-ham-svv-0245
        use                             data-hosts,xiwizard_windowsserver_host
the data-hosts comes first and then the xiwizard_windowsserver_host. I can see the host when I login as data_team but not when logged in as tsc_windows.

Clearly the additive '+' thing isn't working as expected or something is confusing Nagios.


Is there a plugin/add-on for Nagios XI to expand and view the full configuration for a host in the GUI mode like we see in

Nagios Core UI -> left menu -> Configuration -> Hosts -> Update

Re: Hostgroups for specific users

Posted: Wed Jan 18, 2012 11:02 am
by mguthrie
You can view what the text configuration will look like for any of the configs by clicking the Download icon for hosts, and for other configs that use a single config file, there's a "Download" button below the list of configs in the Core Config Manager. This will display information that is currently in the database, and what will be written to file when the Apply Configuration occurs.

Re: Hostgroups for specific users

Posted: Thu Jan 19, 2012 1:29 am
by TSCAdmin
Hello Mike,

When I download the file it shows me exactly what is shown in the host configuration file located at /usr/local/nagios/etc/hosts/host.cfg

I am actually interested in - [url]http://<nagios-server>/nagios/cgi-bin/config.cgi?type=hosts[/url]. It would display the expanded view of all the directives that are associated with a host. By expanded I mean if a contact group is associated with a host then it would display each contact individually not as contact group. Does that make sense? Even if there is a way to show this information programatically or on command line that would work.

I appreciate your response.

Thanks

Re: Hostgroups for specific users

Posted: Thu Jan 19, 2012 5:07 pm
by mguthrie
The full text dump of all compiled object information is located in the /usr/local/nagios/var/objects.cache file. Apart from the Core cgi there isn't really a nice front-end way to view that information.

Re: Hostgroups for specific users

Posted: Tue Jan 24, 2012 3:32 am
by TSCAdmin
Hello Mike,
/usr/local/nagios/var/objects.cache
I had actually been looking for something like this. Many thanks.