nagiostv-react
nagiostv-react copied to clipboard
Show the Hostalias and the Hostname
Hello, Is it possible to show not only the hostname, but also the hostalias on the dashboard? Currently, we always have to define the Hostname in the nagiosconfig as "hostname_description" so that we not only see the hostname, but also some Description of the Host. The hostname does not allow any spaces, so we used the underline. Text to Speech has now the Problem, that it's reading the underline too. Since in the Nagios Config there is also the possibility to define a hostalias which is some kind of description, it would be nice to have a choice to show the Hostalias. Right now it is: Hostname Service Warning My idea: Hostname Hostalias Service Warning
Thanks David
Hi David, Yes this would be nice.
I looked into it a bit and the Nagios CGI API that I use for NagiosTV to tap into the Nagios data does not include the alias in the payload.
We would need to get Nagios-core to accept a PR to add host "alias" output in a few places in this cgi file .
The first here: https://github.com/NagiosEnterprises/nagioscore/blob/master/cgi/statusjson.c#L2751
by adding the line: json_object_append_string(json_details, "alias", &percent_escapes, temp_host->alias);
I tested this locally on my Nagios and this change works well.
However, this above is just to get the alias added to host section. There will be additional changes needed to add the host_alias to service items payload as well.
So, there will be some more hacking required on Nagios-core to get this working. Then once its ready, can submit a PR to the project here https://github.com/NagiosEnterprises/nagioscore/pulls
After PR is accepted in nagios-core then I can make the changes to NagiosTV to support it.
I'm not entirely sure when I will get a chunk of time to get through this work, but documenting here what I found so far that will be helpful when taking this on.
Chris