Service's Host's display_name?
Posted: Fri Jul 22, 2016 8:23 am
Kinda a follow up to a previous thread of mind: (Thread) Usage of display_name in XI, ETA?
I started lightly modifying the Operations Center (http://<server-ip>/nagiosxi/includes/components/nocscreen/noc.php) 's PHP scripts.
I have a little experience with PHP, so I got my tiny changes working. I made all hosts that have a display_name defined to show that instead of the host's host_name.
I am however unable to do the same thing for services because they don't have the display_name of the host.
Instead it looks like the display_name of a service is just the same as the service's service_description.
Is there no no way to make the service inherit the display_name of the host and save it somewhere?
I don't know what would be easiest and naming of possible new directives is not my say, but something along the lines of a "host_display_name" directive would be useful.
Either way, access to the host's display_name through the service would be very handy.
PS: There seems to be a stray ";" on HTML line 682 in the Nagios Core - Object Definitions document, see the quote above.
I started lightly modifying the Operations Center (http://<server-ip>/nagiosxi/includes/components/nocscreen/noc.php) 's PHP scripts.
I have a little experience with PHP, so I got my tiny changes working. I made all hosts that have a display_name defined to show that instead of the host's host_name.
I am however unable to do the same thing for services because they don't have the display_name of the host.
Instead it looks like the display_name of a service is just the same as the service's service_description.
So my question is, how would I get the service's host's display_name?Nagios Core - Object Definitions wrote:service_description;:display_name:
- This directive is used to define the description of the service, which may contain spaces, dashes, and colons (semicolons, apostrophes, and quotation marks should be avoided). No two services associated with the same host can have the same description. Services are uniquely identified with their host_name and service_description directives.
- This directive is used to define an alternate name that should be displayed in the web interface for this service. If not specified, this defaults to the value you specify for the service_description directive. Note: The current CGIs do not use this option, although future versions of the web interface will.
Is there no no way to make the service inherit the display_name of the host and save it somewhere?
I don't know what would be easiest and naming of possible new directives is not my say, but something along the lines of a "host_display_name" directive would be useful.
Either way, access to the host's display_name through the service would be very handy.
PS: There seems to be a stray ";" on HTML line 682 in the Nagios Core - Object Definitions document, see the quote above.